<!DOCTYPE html>


    <html itemscope itemtype="http://schema.org/QAPage" class="html__responsive">

    <head>

        <title>bash - YYYY-MM-DD format date in shell script - Stack Overflow</title>
        <link rel="shortcut icon" href="https://cdn.sstatic.net/Sites/stackoverflow/Img/favicon.ico?v=ec617d715196">
        <link rel="apple-touch-icon" href="https://cdn.sstatic.net/Sites/stackoverflow/Img/apple-touch-icon.png?v=c78bd457575a">
        <link rel="image_src" href="https://cdn.sstatic.net/Sites/stackoverflow/Img/apple-touch-icon.png?v=c78bd457575a"> 
        <link rel="search" type="application/opensearchdescription+xml" title="Stack Overflow" href="/opensearch.xml">
        <link rel="canonical" href="https://stackoverflow.com/questions/1401482/yyyy-mm-dd-format-date-in-shell-script" />
        <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, minimum-scale=1.0">
        <meta property="og:type" content= "website" />
        <meta property="og:url" content="https://stackoverflow.com/questions/1401482/yyyy-mm-dd-format-date-in-shell-script"/>
        <meta property="og:site_name" content="Stack Overflow" />
        <meta property="og:image" itemprop="image primaryImageOfPage" content="https://cdn.sstatic.net/Sites/stackoverflow/Img/apple-touch-icon@2.png?v=73d79a89bded" />
        <meta name="twitter:card" content="summary"/>
        <meta name="twitter:domain" content="stackoverflow.com"/>
        <meta name="twitter:title" property="og:title" itemprop="name" content="YYYY-MM-DD format date in shell script" />
        <meta name="twitter:description" property="og:description" itemprop="description" content="I tried using $(date) in my bash shell script, however, I want the date in YYYY-MM-DD format.&#xA;How do I get this?" />

        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
        <script src="https://cdn.sstatic.net/Js/stub.en.js?v=5ee3b0399cfd"></script>
    
        <link rel="stylesheet" type="text/css" href="https://cdn.sstatic.net/Shared/stacks.css?v=0ee8a05683e7" >
        <link rel="stylesheet" type="text/css" href="https://cdn.sstatic.net/Sites/stackoverflow/primary.css?v=fdb3d3b930f9" >

    
            <link rel="alternate" type="application/atom+xml" title="Feed for question &#x27;YYYY-MM-DD format date in shell script&#x27;" href="/feeds/question/1401482">
            <meta name="twitter:app:country" content="US" />
            <meta name="twitter:app:name:iphone" content="Stack Exchange iOS" />
            <meta name="twitter:app:id:iphone" content="871299723" />
            <meta name="twitter:app:url:iphone" content="se-zaphod://stackoverflow.com/questions/1401482/yyyy-mm-dd-format-date-in-shell-script" />
            <meta name="twitter:app:name:ipad" content="Stack Exchange iOS" />
            <meta name="twitter:app:id:ipad" content="871299723" />
            <meta name="twitter:app:url:ipad" content="se-zaphod://stackoverflow.com/questions/1401482/yyyy-mm-dd-format-date-in-shell-script" />
            <meta name="twitter:app:name:googleplay" content="Stack Exchange Android">
            <meta name="twitter:app:url:googleplay" content="http://stackoverflow.com/questions/1401482/yyyy-mm-dd-format-date-in-shell-script">
            <meta name="twitter:app:id:googleplay" content="com.stackexchange.marvin">
        <script>
            StackExchange.ready(function () {

                    StackExchange.using("snippets", function () {
                        StackExchange.snippets.initSnippetRenderer();
                    });
                    
                StackExchange.using("postValidation", function () {
                    StackExchange.postValidation.initOnBlurAndSubmit($('#post-form'), 2, 'answer');
                });


                StackExchange.question.init({showAnswerHelp:true,totalCommentCount:0,shownCommentCount:0,questionId:1401482});

                styleCode();

                    StackExchange.realtime.subscribeToQuestion('1', '1401482');
                    StackExchange.using("gps", function () { StackExchange.gps.trackOutboundClicks('#content', '.post-text'); });

                
                
            });
        </script>

        
        
        
        
        
        
        


    <script>
        StackExchange.init({"locale":"en","serverTime":1592588426,"routeName":"Questions/Show","stackAuthUrl":"https://stackauth.com","networkMetaHostname":"meta.stackexchange.com","site":{"name":"Stack Overflow","description":"Q&A for professional and enthusiast programmers","isNoticesTabEnabled":true,"enableNewTagCreationWarning":true,"insertSpaceAfterNameTabCompletion":false,"id":1,"childUrl":"https://meta.stackoverflow.com","negativeVoteScoreFloor":null,"enableSocialMediaInSharePopup":true,"protocol":"https"},"user":{"fkey":"f4b78665943d49f72333c3d80d4c7823069e60242e13087f67ce62e267f9013f","tid":"69755307-9311-68c2-0848-82c854a0f32e","rep":0,"isAnonymous":true,"isAnonymousNetworkWide":true,"ab":{"tutorial_tooltips":{"v":"thanks_reaction_icon","g":1}}},"events":{"postType":{"question":1},"postEditionSection":{"title":1,"body":2,"tags":3}},"story":{"minCompleteBodyLength":75,"likedTagsMaxLength":300,"dislikedTagsMaxLength":300},"jobPreferences":{"maxNumDeveloperRoles":2,"maxNumIndustries":4},"svgIconPath":"https://cdn.sstatic.net/Img/svg-icons","svgIconHash":"7aa1e7a5b07a"}, {"userProfile":{"openGraphAPIKey":"4a307e43-b625-49bb-af15-ffadf2bda017"},"userMessaging":{"showNewFeatureNotice":true},"tags":{},"subscriptions":{"defaultMaxTrueUpSeats":1000},"snippets":{"renderDomain":"stacksnippets.net","snippetsEnabled":true},"slack":{"sidebarAdDismissCookie":"slack-sidebar-ad","sidebarAdDismissCookieExpirationDays":60.0},"site":{"allowImageUploads":true,"enableImgurHttps":true,"enableUserHovercards":true,"forceHttpsImages":true,"styleCode":true},"paths":{},"monitoring":{"clientTimingsAbsoluteTimeout":30000,"clientTimingsDebounceTimeout":1000},"mentions":{"maxNumUsersInDropdown":50},"markdown":{"asteriskIntraWordEmphasis":true},"flags":{"allowRetractingCommentFlags":true,"allowRetractingFlags":true},"comments":{},"accounts":{"currentPasswordRequiredForChangingStackIdPassword":true}});
        StackExchange.using.setCacheBreakers({"js/adops.en.js":"22a9bd59b1e9","js/ask.en.js":"635d2cc64f27","js/begin-edit-event.en.js":"011a1d228ca8","js/events.en.js":"da72fc77b277","js/explore-qlist.en.js":"222b04ca33bc","js/full-anon.en.js":"24abb6888af7","js/full.en.js":"ada34f05dd4d","js/help.en.js":"b66b9c5b699c","js/inline-tag-editing.en.js":"3c6b83c6e552","js/keyboard-shortcuts.en.js":"6dc8506386b0","js/mobile.en.js":"8ff5a2e24dd9","js/moderator.en.js":"95481dba6974","js/postCollections-transpiled.en.js":"1d6aeeec3a16","js/post-validation.en.js":"1033e1de5a27","js/prettify-full.en.js":"241e50860e5e","js/question-editor.en.js":"","js/review.en.js":"e1a9346d1d1a","js/revisions.en.js":"d8d5fa1f473d","js/tageditor.en.js":"efe5b5954fe6","js/tageditornew.en.js":"f43de26e2a59","js/tagsuggestions.en.js":"a9ff449efcdc","js/wmd.en.js":"40acadf1f713","js/snippet-javascript-codemirror.en.js":"61bebf415a81"});
        StackExchange.using("gps", function() {
             StackExchange.gps.init(true);
        });
    </script>
    <noscript id="noscript-css"><style>body,.top-bar{margin-top:1.9em}</style></noscript>
    </head>
    <body class="question-page unified-theme">
    <div id="notify-container"></div>
    <div id="custom-header"></div>
        
<header class="top-bar js-top-bar top-bar__network _fixed">
    <div class="wmx12 mx-auto grid ai-center h100" role="menubar">
        <div class="-main grid--cell">
                <a href="#" class="left-sidebar-toggle p0 ai-center jc-center js-left-sidebar-toggle" role="menuitem" aria-haspopup="true" aria-controls="left-sidebar" aria-expanded="false"><span class="ps-relative"></span></a>
                <div class="topbar-dialog leftnav-dialog js-leftnav-dialog dno">
                    <div class="left-sidebar js-unpinned-left-sidebar" data-can-be="left-sidebar" data-is-here-when="sm"></div>
                </div>
                    <a href="https://stackoverflow.com" class="-logo js-gps-track"
                        data-gps-track="top_nav.click({is_current:false, location:2, destination:8})">
                        <span class="-img _glyph">Stack Overflow</span>
                    </a>



        </div>

            <ol class="list-reset grid gs4" role="presentation">
                <li class="grid--cell">
                    <a href="#"
                        class="-marketing-link js-gps-track js-products-menu"
                        aria-controls="products-popover"
                        data-controller="s-popover"
                        data-action="s-popover#toggle"
                        data-s-popover-placement="bottom"
                        data-s-popover-toggle-class="is-selected"
                        data-gps-track="top_nav.products.click({location:2, destination:1})"
                        data-ga="[&quot;top navigation&quot;,&quot;products menu click&quot;,null,null,null]">
                        Products
                    </a>
                </li>

                    <li class="grid--cell md:d-none">
                        <a href="/teams/customers" class="-marketing-link js-gps-track"
                           data-gps-track="top_nav.products.click({location:2, destination:7})"
                            data-ga="[&quot;top navigation&quot;,&quot;customers menu click&quot;,null,null,null]">Customers</a>
                    </li>
                    <li class="grid--cell md:d-none">
                        <a href="/teams/use-cases" class="-marketing-link js-gps-track"
                           data-gps-track="top_nav.products.click({location:2, destination:8})"
                           data-ga="[&quot;top navigation&quot;,&quot;use cases menu click&quot;,null,null,null]">Use cases</a>
                    </li>
            </ol>
            <div class="s-popover ws2 p6"
                    id="products-popover"
                    role="menu"
                    aria-hidden="true">
                <div class="s-popover--arrow"></div>
                <ol class="list-reset s-anchors s-anchors__inherit">
                    <li>
                        <a href="/questions" class="d-block py6 px6 bar-sm h:bg-black-100 js-gps-track"
                           data-gps-track="top_nav.products.click({location:2, destination:2})"
                           data-ga="[&quot;top navigation&quot;,&quot;public qa submenu click&quot;,null,null,null]">
                            <span class="fs-body1 d-block">Stack Overflow</span>
                            <span class="fs-caption d-block fc-light">Public questions and answers</span>
                        </a>
                    </li>
                    <li>
                        <a href="/teams" class="d-block py6 px6 bar-sm h:bg-black-100 js-gps-track"
                           data-gps-track="top_nav.products.click({location:2, destination:3})"
                           data-ga="[&quot;top navigation&quot;,&quot;teams submenu click&quot;,null,null,null]">
                            <span class="fs-body1 d-block">Teams</span>
                            <span class="fs-caption d-block fc-light">Private questions and answers for your team</span>
                        </a>
                    </li>
                    <li>
                        <a href="/enterprise" class="d-block py6 px6 bar-sm h:bg-black-100 js-gps-track"
                           data-gps-track="top_nav.products.click({location:2, destination:4})"
                           data-ga="[&quot;top navigation&quot;,&quot;enterprise submenu click&quot;,null,null,null]">
                            <span class="fs-body1 d-block">Enterprise</span>
                            <span class="fs-caption d-block fc-light">Private self-hosted questions and answers for your enterprise</span>
                        </a>
                    </li>
                    <li>
                        <a href="/jobs?so_source=ProductsMenu&so_medium=StackOverflow" class="d-block py6 px6 bar-sm h:bg-black-100 js-gps-track"
                            data-gps-track="top_nav.products.click({location:2, destination:9})"
                            data-ga="[&quot;top navigation&quot;,&quot;jobs submenu click&quot;,null,null,null]">
                            <span class="fs-body1 d-block">Jobs</span>
                            <span class="fs-caption d-block fc-light">Programming and related technical career opportunities</span>
                        </a>
                    </li>
                    <li class="bt bc-black-3 mln6 mrn6 mt6 pt6 px6" >
                        <a href="https://stackoverflow.com/talent" class="d-block py6 px6 bar-sm h:bg-black-100 js-gps-track"
                           data-gps-track="top_nav.products.click({location:2, destination:5})"
                           data-ga="[&quot;top navigation&quot;,&quot;talent submenu click&quot;,null,null,null]">
                            <span class="fs-body1 d-block">Talent</span>
                            <span class="fs-caption d-block fc-light">Hire technical talent</span>
                        </a>
                    </li>
                    <li>
                        <a href="https://stackoverflow.com/advertising" class="d-block py6 px6 bar-sm h:bg-black-100 js-gps-track"
                           data-gps-track="top_nav.products.click({location:2, destination:6})"
                           data-ga="[&quot;top navigation&quot;,&quot;advertising submenu click&quot;,null,null,null]">
                            <span class="fs-body1 d-block">Advertising</span>
                            <span class="fs-caption d-block fc-light">Reach developers worldwide</span>
                        </a>
                    </li>

                </ol>
            </div>

            <form id="search" role="search" action=/search method="get" class="grid--cell fl-grow1 searchbar px12 js-searchbar " autocomplete="off">
                    <div class="ps-relative">
                        <input name="q"
                               type="text"
                               placeholder="Search&#x2026;"
                               value=""
                               autocomplete="off"
                               maxlength="240"
                               class="s-input s-input__search js-search-field "
                               aria-label="Search"
                               aria-controls="top-search" 
                               data-controller="s-popover"
                               data-action="focus->s-popover#show"
                               data-s-popover-placement="bottom-start"/>
                        <svg aria-hidden="true" class="s-input-icon s-input-icon__search svg-icon iconSearch" width="18" height="18" viewBox="0 0 18 18"><path d="M18 16.5l-5.14-5.18h-.35a7 7 0 10-1.19 1.19v.35L16.5 18l1.5-1.5zM12 7A5 5 0 112 7a5 5 0 0110 0z"/></svg>
                        <div class="s-popover p0 wmx100 wmn4 sm:wmn-initial js-top-search-popover s-popover--arrow__tl" id="top-search" role="menu">
    <div class="js-spinner p24 grid ai-center jc-center d-none">
        <div class="s-spinner s-spinner__sm fc-orange-400">
            <div class="v-visible-sr">Loading&#x2026;</div>
        </div>
    </div>

    <span class="v-visible-sr js-screen-reader-info"></span>
    <div class="js-ac-results overflow-y-auto hmx3 d-none"></div>

    <div class="js-search-hints" aria-describedby="Tips for searching"></div>
</div>
                    </div>
            </form>
        
        

<ol class="overflow-x-auto ml-auto -secondary grid ai-center list-reset h100 user-logged-out" role="presentation">
        <li class="-item searchbar-trigger"><a href="#" class="-link js-searchbar-trigger" role="button" aria-label="Search" aria-haspopup="true" aria-controls="search" title="Click to show search"><svg aria-hidden="true" class="svg-icon iconSearch" width="18" height="18" viewBox="0 0 18 18"><path d="M18 16.5l-5.14-5.18h-.35a7 7 0 10-1.19 1.19v.35L16.5 18l1.5-1.5zM12 7A5 5 0 112 7a5 5 0 0110 0z"/></svg></a></li>

            <li class="-ctas">
                            <a href="https://stackoverflow.com/users/login?ssrc=head&returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f1401482%2fyyyy-mm-dd-format-date-in-shell-script%3fanswertab%3dvotes" class="login-link s-btn s-btn__filled py8 js-gps-track" rel="nofollow"
                               data-gps-track="login.click" data-ga="[&quot;top navigation&quot;,&quot;login button click&quot;,null,null,null]">Log in</a>
                            <a href="https://stackoverflow.com/users/signup?ssrc=head&returnurl=%2fusers%2fstory%2fcurrent" class="login-link s-btn s-btn__primary py8" rel="nofollow" data-ga="[&quot;sign up&quot;,&quot;Sign Up Navigation&quot;,&quot;Header&quot;,null,null]">Sign up</a>

            </li>

    <li class="js-topbar-dialog-corral" role="presentation">
            

    <div class="topbar-dialog siteSwitcher-dialog dno" role="menu">
        <div class="header">
            <h3>
                <a href="https://stackoverflow.com">current community</a>
            </h3>
        </div>
        <div class="modal-content bg-powder-050">
            <ul class="current-site">
                    <li class="grid">
                            <div class="fl1">
                <a href="https://stackoverflow.com"
       class="current-site-link site-link js-gps-track grid gs8 gsx"
       data-id="1"
       data-gps-track="site_switcher.click({ item_type:3 })">
        <div class="favicon favicon-stackoverflow site-icon grid--cell" title="Stack Overflow"></div>
        <span class="grid--cell fl1">
            Stack Overflow
        </span>
    </a>

    </div>
    <div class="related-links">
            <a href="https://stackoverflow.com/help" class="js-gps-track" data-gps-track="site_switcher.click({ item_type:14 })">help</a>
            <a href="https://chat.stackoverflow.com" class="js-gps-track" data-gps-track="site_switcher.click({ item_type:6 })">chat</a>
    </div>

                    </li>
                    <li class="related-site grid">
                            <div class="L-shaped-icon-container">
        <span class="L-shaped-icon"></span>
    </div>

                            <a href="https://meta.stackoverflow.com"
       class=" site-link js-gps-track grid gs8 gsx"
       data-id="552"
       data-gps-track="site.switch({ target_site:552, item_type:3 }),site_switcher.click({ item_type:4 })">
        <div class="favicon favicon-stackoverflowmeta site-icon grid--cell" title="Meta Stack Overflow"></div>
        <span class="grid--cell fl1">
            Meta Stack Overflow
        </span>
    </a>

                    </li>
            </ul>
        </div>

        <div class="header" id="your-communities-header">
            <h3>
your communities            </h3>

        </div>
        <div class="modal-content" id="your-communities-section">

                <div class="call-to-login">
<a href="https://stackoverflow.com/users/signup?ssrc=site_switcher&amp;returnurl=%2fusers%2fstory%2fcurrent" class="login-link js-gps-track" data-gps-track="site_switcher.click({ item_type:10 })">Sign up</a> or <a href="https://stackoverflow.com/users/login?ssrc=site_switcher&amp;returnurl=https%3a%2f%2fstackoverflow.com%2fquestions%2f1401482%2fyyyy-mm-dd-format-date-in-shell-script%3fanswertab%3dvotes" class="login-link js-gps-track" data-gps-track="site_switcher.click({ item_type:11 })">log in</a> to customize your list.                </div>
        </div>

        <div class="header">
            <h3><a href="https://stackexchange.com/sites">more stack exchange communities</a>
            </h3>
            <a href="https://stackoverflow.blog" class="fr">company blog</a>
        </div>
        <div class="modal-content">
                <div class="child-content"></div>
        </div>        
    </div>

    </li>
</ol>
    </div>
</header>
    <div id="js-gdpr-consent-banner" class="p8 ff-sans ps-fixed b0 l0 r0 z-banner" role="banner" aria-hidden="false" style="background-color: #3b4045; color: white;"> 
        <div class="wmx8 mx-auto grid grid__center" role="alertdialog" aria-describedby="notice-message">
            <div class="grid--cell mr12" aria-label="notice-message">
                <p class="mb0 lh-lg">
                    By using our site, you acknowledge that you have read and understand our <a class="s-link s-link__inherit td-underline fc-white" target="_blank" href="https://stackoverflow.com/legal/cookie-policy">Cookie Policy</a>, <a class="s-link s-link__inherit td-underline fc-white" target="_blank" href="https://stackoverflow.com/legal/privacy-policy">Privacy Policy</a>, and our <a class="s-link s-link__inherit td-underline fc-white" target="_blank" href="https://stackoverflow.com/legal/terms-of-service/public">Terms of Service</a>.
                </p>
            </div>
            <div class="grid--cell">
                <a class="s-btn s-btn__muted s-btn__icon js-notice-close" aria-label="notice-dismiss">
                    <svg aria-hidden="true" class="svg-icon iconClear" width="18" height="18" viewBox="0 0 18 18"><path d="M15 4.41L13.59 3 9 7.59 4.41 3 3 4.41 7.59 9 3 13.59 4.41 15 9 10.41 13.59 15 15 13.59 10.41 9 15 4.41z"/></svg>
                </a>
            </div>
        </div>
    </div>

    <script>
        StackExchange.ready(function () { StackExchange.topbar.init(); });
StackExchange.scrollPadding.setPaddingTop(50, 10);    </script>





    <div class="container">
            

<div id="left-sidebar" data-is-here-when="md lg" class="left-sidebar js-pinned-left-sidebar ps-relative">
    <div class="left-sidebar--sticky-container js-sticky-leftnav">
        <nav role="navigation">
            <ol class="nav-links">
        <li class="">
            <a
                href="/"
                class="pl8 js-gps-track nav-links--link"
                
                data-gps-track="top_nav.click({is_current:false, location:2, destination:8})">
Home            </a>
        </li>
                <li>
                    <ol class="nav-links">
                            <li class="fs-fine tt-uppercase ml8 mt16 mb4 fc-light">Public</li>
                                <li class=" youarehere">
            <a id="nav-questions"
                href="/questions"
                class="pl8 js-gps-track nav-links--link -link__with-icon"
                
                data-gps-track="top_nav.click({is_current:true, location:2, destination:1})">
<svg aria-hidden="true" class="svg-icon iconGlobe" width="18" height="18" viewBox="0 0 18 18"><path d="M9 1a8 8 0 100 16A8 8 0 009 1zM8 15.32a6.4 6.4 0 01-5.23-7.75L7 11.68v.8c0 .88.12 1.32 1 1.32v1.52zm5.72-2c-.2-.66-1-1.32-1.72-1.32h-1v-2c0-.44-.56-1-1-1H6V7h1c.44 0 1-.56 1-1V5h2c.88 0 1.4-.72 1.4-1.6v-.33a6.4 6.4 0 012.32 10.24v.01z"/></svg>                    <span class="-link--channel-name">Stack Overflow</span>
            </a>
        </li>

        <li class="">
            <a id="nav-tags"
                href="/tags"
                class=" js-gps-track nav-links--link"
                
                data-gps-track="top_nav.click({is_current:false, location:2, destination:2})">
Tags            </a>
        </li>
        <li class="">
            <a id="nav-users"
                href="/users"
                class=" js-gps-track nav-links--link"
                
                data-gps-track="top_nav.click({is_current:false, location:2, destination:3})">
Users            </a>
        </li>
        <li class="">
            <a id="nav-jobs"
                href="/jobs?so_medium=StackOverflow&amp;so_source=SiteNav"
                class=" js-gps-track nav-links--link"
                
                data-gps-track="top_nav.click({is_current:false, location:2, destination:6})">
Jobs            </a>
        </li>
                    </ol>
                </li>
                    <li>
                        <ol class="nav-links">
                                <li class="grid ai-center jc-space-between ml8 mt24 mb4">
                                    <div class="grid--cell tt-uppercase fs-fine fc-light">Teams</div>
                                    <div class="grid--cell fs-fine fc-light mr4">
                                        <a href="javascript:void(0)" class="s-link s-link__inherit js-gps-track"
                                            role="button"
                                            aria-controls="popover-teams-create-cta"
                                            data-controller="s-popover"
                                            data-action="s-popover#toggle"
                                            data-s-popover-placement="bottom-start"
                                            data-s-popover-toggle-class="is-selected"
                                            data-gps-track="teams.create.left-sidenav.click({ Action: ShowInfo })"
                                            data-ga="[&quot;teams left navigation - anonymous&quot;,&quot;left nav show teams info&quot;,null,null,null]">
                                            What&#x2019;s this?
                                        </a>

                                    </div>
                                </li>
                                <li class="ps-relative">
                                    <a href="https://stackoverflow.com/teams"
                                        class="pl8 js-gps-track nav-links--link"
                                        title="Stack Overflow for Teams is a private, secure spot for your organization's questions and answers."
                                        data-gps-track="teams.create.left-sidenav.click({ Action: TeamsClick })"
                                        data-ga="[&quot;teams left navigation - anonymous&quot;,&quot;left nav team click&quot;,&quot;stackoverflow.com/teams&quot;,null,null]">
                                        <div class="grid ai-center">
                                            <div class="grid--cell s-avatar va-middle bg-orange-400">
                                                <div class="s-avatar--letter mtn1">
                                                    <svg aria-hidden="true" class="svg-icon iconBriefcaseSm" width="14" height="14" viewBox="0 0 14 14"><path d="M4 3a1 1 0 011-1h4a1 1 0 011 1v1h.5c.83 0 1.5.67 1.5 1.5v5c0 .83-.67 1.5-1.5 1.5h-7A1.5 1.5 0 012 10.5v-5C2 4.67 2.67 4 3.5 4H4V3zm5 1V3H5v1h4z"/></svg>
                                                </div>
                                                <svg aria-hidden="true" class="native s-avatar--badge svg-icon iconShieldXSm" width="9" height="10" viewBox="0 0 9 10"><path d="M0 1.84L4.5 0 9 1.84v3.17C9 7.53 6.3 10 4.5 10 2.7 10 0 7.53 0 5.01V1.84z" fill="var(--white)"/><path d="M1 2.5L4.5 1 8 2.5v2.51C8 7.34 5.34 9 4.5 9 3.65 9 1 7.34 1 5.01V2.5zm2.98 3.02L3.2 7h2.6l-.78-1.48a.4.4 0 01.15-.38c.34-.24.73-.7.73-1.14 0-.71-.5-1.23-1.41-1.23-.92 0-1.39.52-1.39 1.23 0 .44.4.9.73 1.14.12.08.18.23.15.38z" fill="var(--black-500)"/></svg>
                                            </div>
                                            <div class="grid--cell pl6">
Free 30 Day Trial                                            </div>
                                        </div>
                                    </a>
                                </li>
                        </ol>
                    </li>
            </ol>
        </nav>
    </div>


        <div class="s-popover w-auto p16"
             id="popover-teams-create-cta"
             role="menu"
             aria-hidden="true">
            <div class="s-popover--arrow"></div>

            <div class="ps-relative overflow-hidden">
                <p class="mb2"><strong>Teams</strong></p>
                <p class="mb16 fs-caption fc-medium">Q&amp;A for Work</p>
                <p class="mb8 fs-caption fc-medium">

                            Stack Overflow for Teams is a private, secure spot for you and
                            your coworkers to find and share information.
                                        </p>
                <a href="https://stackoverflow.com/teams"
                   class="js-gps-track ws-nowrap d-block"
                   data-gps-track="teams.create.left-sidenav.click({ Action: CtaClick })"
                   data-ga="[&quot;teams left navigation - anonymous&quot;,&quot;left nav cta&quot;,&quot;stackoverflow.com/teams&quot;,null,null]">
Learn more                </a>
            </div>

            <div class="ps-absolute t8 r8">
                <svg width="53" height="49" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M49 11l.2 31H18.9L9 49v-7H4V8h31" fill="#CCEAFF" /><path d="M44.5 19v-.3l-.2-.1-18-13-.1-.1H.5v33h4V46l.8-.6 9.9-6.9h29.3V19z" stroke="#1060E1" stroke-miterlimit="10" /><path d="M31 2l6-1.5 7 2V38H14.9L5 45v-7H1V6h25l5-4z" fill="#fff" /><path d="M7 16.5h13m-13 6h14m-14 6h18" stroke="#1060E1" stroke-miterlimit="10" /><path d="M39 30a14 14 0 1 0 0-28 14 14 0 0 0 0 28z" fill="#FFB935" /><path d="M50.5 14a13.5 13.5 0 1 1-27 0 13.5 13.5 0 0 1 27 0z" stroke="#F48024" stroke-miterlimit="10" /><path d="M32.5 21.5v-8h9v8h-9zm2-9.5V9.3A2.5 2.5 0 0 1 37 6.8a2.5 2.5 0 0 1 2.5 2.5V12h-5zm2 3v2m1-2v2" stroke="#fff" stroke-miterlimit="10" /></svg>
            </div>
        </div>

</div>



        <div id="content" class="snippet-hidden">

            
<div itemprop="mainEntity" itemscope itemtype="http://schema.org/Question">
    <link itemprop="image" href="https://cdn.sstatic.net/Sites/stackoverflow/Img/apple-touch-icon.png?v=c78bd457575a">

    <div class="inner-content clearfix">

        

            <div id="question-header" class="grid sm:fd-column">
                        <h1 itemprop="name" class="grid--cell fs-headline1 fl1 ow-break-word mb8"><a href="/questions/1401482/yyyy-mm-dd-format-date-in-shell-script" class="question-hyperlink">YYYY-MM-DD format date in shell script</a></h1>

                <div class="ml12 aside-cta grid--cell print:d-none sm:ml0 sm:mb12 sm:order-first sm:as-end">
                    
    <a href="/questions/ask" class="ws-nowrap s-btn s-btn__primary" >
        Ask Question
    </a>

                </div>
            </div>
            <div class="grid fw-wrap pb8 mb16 bb bc-black-2">
                    <div class="grid--cell ws-nowrap mr16 mb8" title="2009-09-09 19:06:56Z">
                        <span class="fc-light mr2">Asked</span>
                        <time itemprop="dateCreated" datetime="2009-09-09T19:06:56">10 years, 9 months ago</time>
                    </div>
                        <div class="grid--cell ws-nowrap mr16 mb8">
                            <span class="fc-light mr2">Active</span>
                            <a href="?lastactivity" class="s-link s-link__inherit" title="2020-04-16 08:11:07Z">2 months ago</a>
                        </div>
                    <div class="grid--cell ws-nowrap mb8" title="Viewed 1,414,653 times">
                        <span class="fc-light mr2">Viewed</span>
                        1.4m times
                    </div>
            </div>
            <div id="mainbar" role="main" aria-label="question and answers">

                
<div class="question" data-questionid="1401482"  id="question">
    <style>.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{
            margin-bottom:0;
}
</style>
<div id="dfp-tlb" class="everyonelovesstackoverflow everyoneloves__top-leaderboard mb8 mx-auto"></div>

    <div class="post-layout">
        <div class="votecell post-layout--left">
            <div class="js-voting-container grid fd-column ai-stretch gs4 fc-black-200" data-post-id="1401482">
        <button class="js-vote-up-btn grid--cell s-btn s-btn__unset c-pointer" data-controller="s-tooltip" data-s-tooltip-placement="right" title="Upvote this question if you find it clear and useful." aria-pressed="false" aria-label="Up vote" data-selected-classes="fc-theme-primary"><svg aria-hidden="true" class="m0 svg-icon iconArrowUpLg" width="36" height="36" viewBox="0 0 36 36"><path d="M2 26h32L18 10 2 26z"/></svg></button>
        <div class="js-vote-count grid--cell fc-black-500 fs-title grid fd-column ai-center" itemprop="upvoteCount" data-value="1114">1114</div>
        <button class="js-vote-down-btn grid--cell s-btn s-btn__unset c-pointer" data-controller="s-tooltip" data-s-tooltip-placement="right" title="Downvote this question if you find it unclear or not useful." aria-pressed="false" aria-label="Down vote" data-selected-classes="fc-theme-primary"><svg aria-hidden="true" class="m0 svg-icon iconArrowDownLg" width="36" height="36" viewBox="0 0 36 36"><path d="M2 10h32L18 26 2 10z"/></svg></button>

        <button class="js-bookmark-btn s-btn s-btn__unset c-pointer py4 js-gps-track" 
                data-controller="s-tooltip" data-s-tooltip-placement="right" title="Bookmark this question."
                aria-pressed="false" aria-label="Bookmark (205)" data-selected-classes="fc-yellow-600"
                data-gps-track="post.click({ item: 1, priv: 0, post_type: 1 })">
            <svg aria-hidden="true" class="svg-icon iconBookmark" width="18" height="18" viewBox="0 0 18 18"><path d="M6 1a2 2 0 00-2 2v14l5-4 5 4V3a2 2 0 00-2-2H6zm3.9 3.83h2.9l-2.35 1.7.9 2.77L9 7.59l-2.35 1.7.9-2.76-2.35-1.7h2.9L9 2.06l.9 2.77z"/></svg>
            <div class="js-bookmark-count mt4" data-value="205">205</div>
        </button>
    

    
        <a class="js-post-issue grid--cell s-btn s-btn__unset c-pointer py6 mx-auto" href="/posts/1401482/timeline" data-shortcut="T" data-controller="s-tooltip" data-s-tooltip-placement="right" title="Show activity on this post." aria-label="Timeline"><svg aria-hidden="true" class="mln2 mr0 svg-icon iconHistory" width="19" height="18" viewBox="0 0 19 18"><path d="M3 9a8 8 0 113.73 6.77L8.2 14.3A6 6 0 105 9l3.01-.01-4 4-4-4h3L3 9zm7-4h1.01L11 9.36l3.22 2.1-.6.93L10 10V5z"/></svg></a>

</div>

        </div>

        

<div class="postcell post-layout--right">
    
    <div class="post-text" itemprop="text">
                    
<p>I tried using <code>$(date)</code> in my bash shell script, however, I want the date in <code>YYYY-MM-DD</code> format.<br>
How do I get this?</p>
    </div>

        <div class="post-taglist grid gs4 gsy fd-column">
            <div class="grid ps-relative d-block">
                <a href="/questions/tagged/bash" class="post-tag" title="show questions tagged &#39;bash&#39;" rel="tag">bash</a> <a href="/questions/tagged/shell" class="post-tag" title="show questions tagged &#39;shell&#39;" rel="tag">shell</a> <a href="/questions/tagged/date" class="post-tag" title="show questions tagged &#39;date&#39;" rel="tag">date</a> <a href="/questions/tagged/strftime" class="post-tag" title="show questions tagged &#39;strftime&#39;" rel="tag">strftime</a> 
            </div>
        </div>

    <div class="mb0 ">
        <div class="mt16 grid gs8 gsy fw-wrap jc-end ai-start pt4">
            <div class="grid--cell mr16" style="flex: 1 1 100px;">
                

<div class="post-menu">
    <a href="/q/1401482"
       rel="nofollow"
       itemprop="url"
       class="js-share-link js-gps-track"
       title="short permalink to this question"
       data-gps-track="post.click({ item: 2, priv: 0, post_type: 1 })"
       data-controller="se-share-sheet"
       data-se-share-sheet-title="Share a link to this question"
       data-se-share-sheet-subtitle=""
       data-se-share-sheet-post-type="question"
       data-se-share-sheet-social="facebook twitter devto"
       data-se-share-sheet-location="1"
       data-se-share-sheet-license-url="https%3a%2f%2fcreativecommons.org%2flicenses%2fby-sa%2f4.0%2f"
       data-se-share-sheet-license-name="CC BY-SA 4.0"
       data-s-popover-placement="bottom-start">share</a>
        <span class="lsep">|</span>
                <a href="/posts/1401482/edit" class="suggest-edit-post js-gps-track" data-gps-track="post.click({ item: 6, priv: 0, post_type: 1 })" title="">improve this question</a>
        <span class="lsep">|</span>
    <button id="btnFollowPost-1401482" class="s-btn s-btn__link fc-black-400 h:fc-black-700 pb2 js-follow-post js-follow-question js-gps-track" role="button"
            data-gps-track="post.click({ item: 14, priv: 0, post_type: 1 })"
            data-controller="s-tooltip " data-s-tooltip-placement="bottom"
            data-s-popover-placement="bottom" aria-controls=""
            title="Follow this question to receive notifications">
        follow
    </button>
        <span class="lsep">|</span>
</div>

            </div>

                <div class="post-signature grid--cell">
<div class="user-info user-hover">
    <div class="user-action-time">
        <a href="/posts/1401482/revisions" title="show all edits to this post"
                         class="js-gps-track"
                         data-gps-track="post.click({ item: 4, priv: 0, post_type: 1 })">edited <span title="2020-04-16 08:11:07Z" class="relativetime">Apr 16 at 8:11</span></a>
    </div>
    <div class="user-gravatar32">
        <a href="/users/806202/arsen-khachaturyan"><div class="gravatar-wrapper-32"><img src="https://i.stack.imgur.com/hujFk.jpg?s=32&amp;g=1" alt="" width="32" height="32" class="bar-sm"></div></a>
    </div>
    <div class="user-details">
        <a href="/users/806202/arsen-khachaturyan">Arsen Khachaturyan</a>
        <div class="-flair">
            <span class="reputation-score" title="reputation score " dir="ltr">4,937</span><span title="3 gold badges" aria-hidden="true"><span class="badge1"></span><span class="badgecount">3</span></span><span class="v-visible-sr">3 gold badges</span><span title="27 silver badges" aria-hidden="true"><span class="badge2"></span><span class="badgecount">27</span></span><span class="v-visible-sr">27 silver badges</span><span title="31 bronze badges" aria-hidden="true"><span class="badge3"></span><span class="badgecount">31</span></span><span class="v-visible-sr">31 bronze badges</span>
        </div>
    </div>
</div>                </div>
            <div class="post-signature owner grid--cell">
                <div class="user-info ">
    <div class="user-action-time">
        asked <span title="2009-09-09 19:06:56Z" class="relativetime">Sep 9 '09 at 19:06</span>
    </div>
    <div class="user-gravatar32">
        <a href="/users/45730/kapsh"><div class="gravatar-wrapper-32"><img src="https://www.gravatar.com/avatar/96869aed4de4cb65c3690b66c783dad0?s=32&amp;d=identicon&amp;r=PG" alt="" width="32" height="32" class="bar-sm"></div></a>
    </div>
    <div class="user-details" itemprop="author" itemscope itemtype="http://schema.org/Person">
        <a href="/users/45730/kapsh">Kapsh</a><span class="d-none" itemprop="name">Kapsh</span>
        <div class="-flair">
            <span class="reputation-score" title="reputation score 16,491" dir="ltr">16.5k</span><span title="11 gold badges" aria-hidden="true"><span class="badge1"></span><span class="badgecount">11</span></span><span class="v-visible-sr">11 gold badges</span><span title="32 silver badges" aria-hidden="true"><span class="badge2"></span><span class="badgecount">32</span></span><span class="v-visible-sr">32 silver badges</span><span title="40 bronze badges" aria-hidden="true"><span class="badge3"></span><span class="badgecount">40</span></span><span class="v-visible-sr">40 bronze badges</span>
        </div>
    </div>
</div>

            </div>
        </div>
    </div>
    
</div>


                <div class="post-layout--right">
        <div id="comments-1401482" class="comments js-comments-container bt bc-black-2 mt12  dno" data-post-id="1401482" data-min-length="15">
            <ul class="comments-list js-comments-list"
                    data-remaining-comments-count="0"
                    data-canpost="false"
                    data-cansee="true"
                    data-comments-unavailable="false"
                    data-addlink-disabled="true">

            </ul>
	    </div>

        <div id="comments-link-1401482" data-rep=50 data-anon=true>
                    <a class="js-add-link comments-link disabled-link" title="Use comments to ask for more information or suggest improvements. Avoid answering questions in comments."  href="#" role="button">add a comment</a>
                <span class="js-link-separator dno">&nbsp;|&nbsp;</span>
            <a class="js-show-link comments-link dno" title="expand to show all comments on this post" href=# onclick="" role="button"></a>
        </div>         
    </div>
    </div>
</div>


<div id="dfp-isb" class="everyonelovesstackoverflow everyoneloves__inline-sidebar mt24 mx-auto"></div>

                <div id="answers">

                    <a name="tab-top"></a>
                    <div id="answers-header">
                        <div class="answers-subheader grid ai-center mb8">
                            <div class="grid--cell fl1">
                                <h2 class="mb0" data-answercount="13">
                                        13 Answers
                                    <span style="display:none;" itemprop="answerCount">13</span>
                                </h2>
                            </div>
                            <div class="grid--cell">
                                <div class=" grid s-btn-group js-filter-btn">
        <a class="grid--cell s-btn s-btn__muted s-btn__outlined" href="/questions/1401482/yyyy-mm-dd-format-date-in-shell-script?answertab=active#tab-top" data-nav-xhref="" title="Answers with the latest activity first" data-value="active" data-shortcut="A">
            Active</a>
        <a class="grid--cell s-btn s-btn__muted s-btn__outlined" href="/questions/1401482/yyyy-mm-dd-format-date-in-shell-script?answertab=oldest#tab-top" data-nav-xhref="" title="Answers in the order they were provided" data-value="oldest" data-shortcut="O">
            Oldest</a>
        <a class="youarehere is-selected grid--cell s-btn s-btn__muted s-btn__outlined" href="/questions/1401482/yyyy-mm-dd-format-date-in-shell-script?answertab=votes#tab-top" data-nav-xhref="" title="Answers with the highest score first" data-value="votes" data-shortcut="V">
            Votes</a>
</div>

                            </div>
                        </div>
                            
                    </div>


                                          
<a name="1401495"></a>
<div id="answer-1401495" class="answer accepted-answer" data-answerid="1401495"  itemprop="acceptedAnswer" itemscope itemtype="http://schema.org/Answer">
    <div class="post-layout">
        <div class="votecell post-layout--left">
            <div class="js-voting-container grid fd-column ai-stretch gs4 fc-black-200" data-post-id="1401495">
        <button class="js-vote-up-btn grid--cell s-btn s-btn__unset c-pointer" data-controller="s-tooltip" data-s-tooltip-placement="right" title="Upvote this answer if you find it clear and useful." aria-pressed="false" aria-label="Up vote" data-selected-classes="fc-theme-primary"><svg aria-hidden="true" class="m0 svg-icon iconArrowUpLg" width="36" height="36" viewBox="0 0 36 36"><path d="M2 26h32L18 10 2 26z"/></svg></button>
        <div class="js-vote-count grid--cell fc-black-500 fs-title grid fd-column ai-center" itemprop="upvoteCount" data-value="1834">1834</div>
        <button class="js-vote-down-btn grid--cell s-btn s-btn__unset c-pointer" data-controller="s-tooltip" data-s-tooltip-placement="right" title="Downvote this answer if you find it unclear or not useful." aria-pressed="false" aria-label="Down vote" data-selected-classes="fc-theme-primary"><svg aria-hidden="true" class="m0 svg-icon iconArrowDownLg" width="36" height="36" viewBox="0 0 36 36"><path d="M2 10h32L18 26 2 10z"/></svg></button>

    
            <div class="js-accepted-answer-indicator grid--cell fc-green-500 ta-center py4" data-s-tooltip-placement="right" title="Loading when this answer was accepted&#x2026;" tabindex="0" role="note" aria-label="Accepted">
                <svg aria-hidden="true" class="svg-icon iconCheckmarkLg" width="36" height="36" viewBox="0 0 36 36"><path d="M6 14l8 8L30 6v8L14 30l-8-8v-8z"/></svg>
            </div>

        
<div class="js-reactions grid--cell"
     data-controller="reactions"
     data-count="0"
     data-action="post:reactionsInit->reactions#updateUI">
        <button class="s-btn s-btn__unset w100 py4 c-pointer" aria-label="Thanks (0)" data-target="reactions.button" data-action="reactions#tryToggle keypress->reactions#tryToggle" aria-pressed="false"
                data-controller="s-tooltip" data-s-tooltip-placement="right" data-s-tooltip-html-title="Say &lt;b&gt;thanks&lt;/b&gt; for this answer."><svg aria-hidden="true" class="svg-icon iconHandsTogether" width="18" height="18" viewBox="0 0 18 18"><path d="M3.85 1.15a.5.5 0 10-.7.7l2 2a.5.5 0 10.7-.7l-2-2zM5.5 6h-2a.5.5 0 000 1h2a.5.5 0 000-1zm10 1h-2a.5.5 0 010-1h2a.5.5 0 010 1zm.35-5.15a.5.5 0 00-.7-.7l-2 2a.5.5 0 00.7.7l2-2z" opacity=".4"/><path d="M8.21 16.49c-.44.37-1.02.55-1.6.51H5v-6h2l1-7.63c0-.2.23-.37.5-.37s.5.17.5.37V15a2.23 2.23 0 01-.79 1.49zm2.58 0c.44.37 1.02.55 1.6.51H14v-6h-2l-1-7.63c0-.2-.23-.37-.5-.37s-.5.17-.5.37V15c.06.58.34 1.11.79 1.49z" fill="#FFC166"/><path d="M2.5 11c-.83 0-1.5.67-1.5 1.5v3c0 .83.67 1.5 1.5 1.5H4v-6H2.5zm14 0H15v6h1.5c.83 0 1.5-.67 1.5-1.5v-3c0-.83-.67-1.5-1.5-1.5z" opacity=".7" fill="#07C"/></svg></button>
        <div class="ta-center fc-black-200 d-none" data-target="reactions.count"
             data-controller="s-tooltip" data-s-tooltip-placement="right" data-s-tooltip-html-title="0 others reacted with &lt;b&gt;thanks&lt;/b&gt;.">0</div>
</div>

    
        <a class="js-post-issue grid--cell s-btn s-btn__unset c-pointer py6 mx-auto" href="/posts/1401495/timeline" data-shortcut="T" data-controller="s-tooltip" data-s-tooltip-placement="right" title="Show activity on this post." aria-label="Timeline"><svg aria-hidden="true" class="mln2 mr0 svg-icon iconHistory" width="19" height="18" viewBox="0 0 19 18"><path d="M3 9a8 8 0 113.73 6.77L8.2 14.3A6 6 0 105 9l3.01-.01-4 4-4-4h3L3 9zm7-4h1.01L11 9.36l3.22 2.1-.6.93L10 10V5z"/></svg></a>

</div>

        </div>

        

<div class="answercell post-layout--right">
    
    <div class="post-text" itemprop="text">
<p>In bash (>=4.2) it is preferable to use printf's built-in date formatter (part of bash) rather than the external <code>date</code> (usually GNU date).</p>

<p>As such:</p>

<pre><code># put current date as yyyy-mm-dd in $date
# -1 -&gt; explicit current date, bash &gt;=4.3 defaults to current time if not provided
# -2 -&gt; start time for shell
printf -v date '%(%Y-%m-%d)T\n' -1 

# put current date as yyyy-mm-dd HH:MM:SS in $date
printf -v date '%(%Y-%m-%d %H:%M:%S)T\n' -1 

# to print directly remove -v flag, as such:
printf '%(%Y-%m-%d)T\n' -1
# -&gt; current date printed to terminal
</code></pre>

<p>In bash (&lt;4.2): </p>

<pre><code># put current date as yyyy-mm-dd in $date
date=$(date '+%Y-%m-%d')

# put current date as yyyy-mm-dd HH:MM:SS in $date
date=$(date '+%Y-%m-%d %H:%M:%S')

# print current date directly
echo $(date '+%Y-%m-%d')
</code></pre>

<p>Other available date formats can be viewed from the <a href="http://man7.org/linux/man-pages/man1/date.1.html" rel="noreferrer">date man pages</a> (for external non-bash specific command):</p>

<pre><code>man date
</code></pre>
    </div>
    <div class="grid mb0 fw-wrap ai-start jc-end gs8 gsy">
        <time itemprop="dateCreated" datetime="2009-09-09T19:08:57"></time>
        <div class="grid--cell mr16" style="flex: 1 1 100px;">
            

<div class="post-menu">
    <a href="/a/1401495"
       rel="nofollow"
       itemprop="url"
       class="js-share-link js-gps-track"
       title="short permalink to this answer"
       data-gps-track="post.click({ item: 2, priv: 0, post_type: 2 })"
       data-controller="se-share-sheet"
       data-se-share-sheet-title="Share a link to this answer"
       data-se-share-sheet-subtitle=""
       data-se-share-sheet-post-type="answer"
       data-se-share-sheet-social="facebook twitter devto"
       data-se-share-sheet-location="2"
       data-se-share-sheet-license-url="https%3a%2f%2fcreativecommons.org%2flicenses%2fby-sa%2f4.0%2f"
       data-se-share-sheet-license-name="CC BY-SA 4.0"
       data-s-popover-placement="bottom-start">share</a>
        <span class="lsep">|</span>
                <a href="/posts/1401495/edit" class="suggest-edit-post js-gps-track" data-gps-track="post.click({ item: 6, priv: 0, post_type: 2 })" title="">improve this answer</a>
        <span class="lsep">|</span>
    <button id="btnFollowPost-1401495" class="s-btn s-btn__link fc-black-400 h:fc-black-700 pb2 js-follow-post js-follow-answer js-gps-track" role="button"
            data-gps-track="post.click({ item: 14, priv: 0, post_type: 2 })"
            data-controller="s-tooltip " data-s-tooltip-placement="bottom"
            data-s-popover-placement="bottom" aria-controls=""
            title="Follow this answer to receive notifications">
        follow
    </button>
        <span class="lsep">|</span>
</div>

        </div>
    <div class="post-signature grid--cell fl0">
<div class="user-info ">
    <div class="user-action-time">
        <a href="/posts/1401495/revisions" title="show all edits to this post"
                         class="js-gps-track"
                         data-gps-track="post.click({ item: 4, priv: 0, post_type: 2 })">edited <span title="2019-07-12 11:53:20Z" class="relativetime">Jul 12 '19 at 11:53</span></a>
    </div>
    <div class="user-gravatar32">
        <a href="/users/691294/flindeberg"><div class="gravatar-wrapper-32"><img src="https://www.gravatar.com/avatar/0fb2a5bea35e0567300aa4f58634e6e4?s=32&amp;d=identicon&amp;r=PG&amp;f=1" alt="" width="32" height="32" class="bar-sm"></div></a>
    </div>
    <div class="user-details">
        <a href="/users/691294/flindeberg">flindeberg</a>
        <div class="-flair">
            <span class="reputation-score" title="reputation score " dir="ltr">4,353</span><span title="1 gold badge" aria-hidden="true"><span class="badge1"></span><span class="badgecount">1</span></span><span class="v-visible-sr">1 gold badge</span><span title="19 silver badges" aria-hidden="true"><span class="badge2"></span><span class="badgecount">19</span></span><span class="v-visible-sr">19 silver badges</span><span title="33 bronze badges" aria-hidden="true"><span class="badge3"></span><span class="badgecount">33</span></span><span class="v-visible-sr">33 bronze badges</span>
        </div>
    </div>
</div>    </div>


    <div class="post-signature grid--cell fl0">
        <div class="user-info user-hover">
    <div class="user-action-time">
        answered <span title="2009-09-09 19:08:57Z" class="relativetime">Sep 9 '09 at 19:08</span>
    </div>
    <div class="user-gravatar32">
        <a href="/users/11123/philip-fourie"><div class="gravatar-wrapper-32"><img src="https://www.gravatar.com/avatar/e7a0b55585b62d8dfcc4e9c6accc58e8?s=32&amp;d=identicon&amp;r=PG" alt="" width="32" height="32" class="bar-sm"></div></a>
    </div>
    <div class="user-details" itemprop="author" itemscope itemtype="http://schema.org/Person">
        <a href="/users/11123/philip-fourie">Philip Fourie</a><span class="d-none" itemprop="name">Philip Fourie</span>
        <div class="-flair">
            <span class="reputation-score" title="reputation score 88,267" dir="ltr">88.3k</span><span title="10 gold badges" aria-hidden="true"><span class="badge1"></span><span class="badgecount">10</span></span><span class="v-visible-sr">10 gold badges</span><span title="56 silver badges" aria-hidden="true"><span class="badge2"></span><span class="badgecount">56</span></span><span class="v-visible-sr">56 silver badges</span><span title="79 bronze badges" aria-hidden="true"><span class="badge3"></span><span class="badgecount">79</span></span><span class="v-visible-sr">79 bronze badges</span>
        </div>
    </div>
</div>

    </div>
    </div>
    
</div>


                <div class="post-layout--right">
        <div id="comments-1401495" class="comments js-comments-container bt bc-black-2 mt12 " data-post-id="1401495" data-min-length="15">
            <ul class="comments-list js-comments-list"
                    data-remaining-comments-count="12"
                    data-canpost="false"
                    data-cansee="true"
                    data-comments-unavailable="false"
                    data-addlink-disabled="true">

                        <li id="comment-14852939" class="comment js-comment " data-comment-id="14852939">
        <div class="js-comment-actions comment-actions">
            <div class="comment-score js-comment-edit-hide">
                    <span title="number of &#x27;useful comment&#x27; votes received"
                            class="cool">4</span>
            </div>
        </div>
        <div class="comment-text js-comment-text-and-form">
            <div class="comment-body js-comment-edit-hide">
                
                <span class="comment-copy">In the first days of the month I get &quot;2012-07-1&quot; which is not what the OP asks for.</span>
                
&ndash;&nbsp;<a href="/users/197574/dermike"
                       title="12,419 reputation"
                       class="comment-user">DerMike</a>
                <span class="comment-date" dir="ltr"><span title="2012-07-02 09:29:35Z, License: CC BY-SA 3.0" class="relativetime-clean">Jul 2 '12 at 9:29</span></span>
            </div>
        </div>
    </li>
    <li id="comment-21960581" class="comment js-comment " data-comment-id="21960581">
        <div class="js-comment-actions comment-actions">
            <div class="comment-score js-comment-edit-hide">
                    <span title="number of &#x27;useful comment&#x27; votes received"
                            class="warm">6</span>
            </div>
        </div>
        <div class="comment-text js-comment-text-and-form">
            <div class="comment-body js-comment-edit-hide">
                
                <span class="comment-copy">This works for me.  Man page suggests that the first of the month is 01, no 1 (Ex. 2012-07-01).</span>
                
&ndash;&nbsp;<a href="/users/688355/bob-kuhar"
                       title="9,171 reputation"
                       class="comment-user">Bob Kuhar</a>
                <span class="comment-date" dir="ltr"><span title="2013-03-19 18:59:25Z, License: CC BY-SA 3.0" class="relativetime-clean">Mar 19 '13 at 18:59</span></span>
            </div>
        </div>
    </li>
    <li id="comment-46330379" class="comment js-comment " data-comment-id="46330379">
        <div class="js-comment-actions comment-actions">
            <div class="comment-score js-comment-edit-hide">
                    <span title="number of &#x27;useful comment&#x27; votes received"
                            class="supernova">31</span>
            </div>
        </div>
        <div class="comment-text js-comment-text-and-form">
            <div class="comment-body js-comment-edit-hide">
                
                <span class="comment-copy">DATE=$(date +%d-%m-%Y&quot; &quot;%H:%M:%S); What I ended up after.</span>
                
&ndash;&nbsp;<a href="/users/465822/jacopkane"
                       title="657 reputation"
                       class="comment-user">JacopKane</a>
                <span class="comment-date" dir="ltr"><span title="2015-03-14 04:53:20Z, License: CC BY-SA 3.0" class="relativetime-clean">Mar 14 '15 at 4:53</span></span>
            </div>
        </div>
    </li>
    <li id="comment-66347163" class="comment js-comment " data-comment-id="66347163">
        <div class="js-comment-actions comment-actions">
            <div class="comment-score js-comment-edit-hide">
                    <span title="number of &#x27;useful comment&#x27; votes received"
                            class="warm">5</span>
            </div>
        </div>
        <div class="comment-text js-comment-text-and-form">
            <div class="comment-body js-comment-edit-hide">
                
                <span class="comment-copy">I haven&#39;t checked how widely available these shortcuts are, but in some distributions you can use <code>+%F %T</code> as a shortcut for <code>+%Y-%m-%d %H:%M:%S</code>. Just note that <i>some filesystems</i> (cough**HFS) will convert the <code>:</code> to a <code>&#47;</code>, giving you a string like <code>2016-09-15 11&#47;05&#47;00</code> which is mighty confusing.</span>
                
&ndash;&nbsp;<a href="/users/70876/beporter"
                       title="2,991 reputation"
                       class="comment-user">beporter</a>
                <span class="comment-date" dir="ltr"><span title="2016-09-15 16:07:31Z, License: CC BY-SA 3.0" class="relativetime-clean">Sep 15 '16 at 16:07</span></span>
            </div>
        </div>
    </li>
    <li id="comment-66689736" class="comment js-comment " data-comment-id="66689736">
        <div class="js-comment-actions comment-actions">
            <div class="comment-score js-comment-edit-hide">
                    <span title="number of &#x27;useful comment&#x27; votes received"
                            class="hot">24</span>
            </div>
        </div>
        <div class="comment-text js-comment-text-and-form">
            <div class="comment-body js-comment-edit-hide">
                
                <span class="comment-copy">The preferred syntax in any POSIX-compliant shell in this millennium is <code>date=$(date)</code> instead of <code>date=`date`</code>. Also, don&#39;t use uppercase for your private variables; uppercase variable names are reserved for the system.</span>
                
&ndash;&nbsp;<a href="/users/874188/tripleee"
                       title="118,287 reputation"
                       class="comment-user">tripleee</a>
                <span class="comment-date" dir="ltr"><span title="2016-09-26 05:53:24Z, License: CC BY-SA 3.0" class="relativetime-clean">Sep 26 '16 at 5:53</span></span>
                        <span title="this comment was edited 1 time">
                            <svg aria-hidden="true" class="va-text-bottom o50 svg-icon iconPencilSm" width="14" height="14" viewBox="0 0 14 14"><path d="M11.1 1.71l1.13 1.12c.2.2.2.51 0 .71L11.1 4.7 9.21 2.86l1.17-1.15c.2-.2.51-.2.71 0zM2 10.12l6.37-6.43 1.88 1.88L3.88 12H2v-1.88z"/></svg>
                        </span>
            </div>
        </div>
    </li>

            </ul>
	    </div>

        <div id="comments-link-1401495" data-rep=50 data-anon=true>
                    <a class="js-add-link comments-link dno" title="Use comments to ask for more information or suggest improvements. Say thanks by reacting to the answer."  href="#" role="button"></a>
                <span class="js-link-separator dno">&nbsp;|&nbsp;</span>
            <a class="js-show-link comments-link " title="expand to show all comments on this post" href=# onclick="" role="button">show <b>12</b> more comments</a>
        </div>         
    </div>
    </div>
</div>

<div id="dfp-mlb" class="everyonelovesstackoverflow everyoneloves__mid-leaderboard my8 mx-auto"></div>
                                          
<a name="1401502"></a>
<div id="answer-1401502" class="answer" data-answerid="1401502"  itemprop="suggestedAnswer" itemscope itemtype="http://schema.org/Answer">
    <div class="post-layout">
        <div class="votecell post-layout--left">
            <div class="js-voting-container grid fd-column ai-stretch gs4 fc-black-200" data-post-id="1401502">
        <button class="js-vote-up-btn grid--cell s-btn s-btn__unset c-pointer" data-controller="s-tooltip" data-s-tooltip-placement="right" title="Upvote this answer if you find it clear and useful." aria-pressed="false" aria-label="Up vote" data-selected-classes="fc-theme-primary"><svg aria-hidden="true" class="m0 svg-icon iconArrowUpLg" width="36" height="36" viewBox="0 0 36 36"><path d="M2 26h32L18 10 2 26z"/></svg></button>
        <div class="js-vote-count grid--cell fc-black-500 fs-title grid fd-column ai-center" itemprop="upvoteCount" data-value="335">335</div>
        <button class="js-vote-down-btn grid--cell s-btn s-btn__unset c-pointer" data-controller="s-tooltip" data-s-tooltip-placement="right" title="Downvote this answer if you find it unclear or not useful." aria-pressed="false" aria-label="Down vote" data-selected-classes="fc-theme-primary"><svg aria-hidden="true" class="m0 svg-icon iconArrowDownLg" width="36" height="36" viewBox="0 0 36 36"><path d="M2 10h32L18 26 2 10z"/></svg></button>

    
            <div class="js-accepted-answer-indicator grid--cell fc-green-500 ta-center py4 d-none" data-s-tooltip-placement="right" title="Loading when this answer was accepted&#x2026;" tabindex="0" role="note" aria-label="Accepted">
                <svg aria-hidden="true" class="svg-icon iconCheckmarkLg" width="36" height="36" viewBox="0 0 36 36"><path d="M6 14l8 8L30 6v8L14 30l-8-8v-8z"/></svg>
            </div>

        
<div class="js-reactions grid--cell"
     data-controller="reactions"
     data-count="0"
     data-action="post:reactionsInit->reactions#updateUI">
        <button class="s-btn s-btn__unset w100 py4 c-pointer" aria-label="Thanks (0)" data-target="reactions.button" data-action="reactions#tryToggle keypress->reactions#tryToggle" aria-pressed="false"
                data-controller="s-tooltip" data-s-tooltip-placement="right" data-s-tooltip-html-title="Say &lt;b&gt;thanks&lt;/b&gt; for this answer."><svg aria-hidden="true" class="svg-icon iconHandsTogether" width="18" height="18" viewBox="0 0 18 18"><path d="M3.85 1.15a.5.5 0 10-.7.7l2 2a.5.5 0 10.7-.7l-2-2zM5.5 6h-2a.5.5 0 000 1h2a.5.5 0 000-1zm10 1h-2a.5.5 0 010-1h2a.5.5 0 010 1zm.35-5.15a.5.5 0 00-.7-.7l-2 2a.5.5 0 00.7.7l2-2z" opacity=".4"/><path d="M8.21 16.49c-.44.37-1.02.55-1.6.51H5v-6h2l1-7.63c0-.2.23-.37.5-.37s.5.17.5.37V15a2.23 2.23 0 01-.79 1.49zm2.58 0c.44.37 1.02.55 1.6.51H14v-6h-2l-1-7.63c0-.2-.23-.37-.5-.37s-.5.17-.5.37V15c.06.58.34 1.11.79 1.49z" fill="#FFC166"/><path d="M2.5 11c-.83 0-1.5.67-1.5 1.5v3c0 .83.67 1.5 1.5 1.5H4v-6H2.5zm14 0H15v6h1.5c.83 0 1.5-.67 1.5-1.5v-3c0-.83-.67-1.5-1.5-1.5z" opacity=".7" fill="#07C"/></svg></button>
        <div class="ta-center fc-black-200 d-none" data-target="reactions.count"
             data-controller="s-tooltip" data-s-tooltip-placement="right" data-s-tooltip-html-title="0 others reacted with &lt;b&gt;thanks&lt;/b&gt;.">0</div>
</div>

    
        <a class="js-post-issue grid--cell s-btn s-btn__unset c-pointer py6 mx-auto" href="/posts/1401502/timeline" data-shortcut="T" data-controller="s-tooltip" data-s-tooltip-placement="right" title="Show activity on this post." aria-label="Timeline"><svg aria-hidden="true" class="mln2 mr0 svg-icon iconHistory" width="19" height="18" viewBox="0 0 19 18"><path d="M3 9a8 8 0 113.73 6.77L8.2 14.3A6 6 0 105 9l3.01-.01-4 4-4-4h3L3 9zm7-4h1.01L11 9.36l3.22 2.1-.6.93L10 10V5z"/></svg></a>

</div>

        </div>

        

<div class="answercell post-layout--right">
    
    <div class="post-text" itemprop="text">
<p>Try: <code>$(date +%F)</code></p>
    </div>
    <div class="grid mb0 fw-wrap ai-start jc-end gs8 gsy">
        <time itemprop="dateCreated" datetime="2009-09-09T19:11:01"></time>
        <div class="grid--cell mr16" style="flex: 1 1 100px;">
            

<div class="post-menu">
    <a href="/a/1401502"
       rel="nofollow"
       itemprop="url"
       class="js-share-link js-gps-track"
       title="short permalink to this answer"
       data-gps-track="post.click({ item: 2, priv: 0, post_type: 2 })"
       data-controller="se-share-sheet"
       data-se-share-sheet-title="Share a link to this answer"
       data-se-share-sheet-subtitle=""
       data-se-share-sheet-post-type="answer"
       data-se-share-sheet-social="facebook twitter devto"
       data-se-share-sheet-location="2"
       data-se-share-sheet-license-url="https%3a%2f%2fcreativecommons.org%2flicenses%2fby-sa%2f2.5%2f"
       data-se-share-sheet-license-name="CC BY-SA 2.5"
       data-s-popover-placement="bottom-start">share</a>
        <span class="lsep">|</span>
                <a href="/posts/1401502/edit" class="suggest-edit-post js-gps-track" data-gps-track="post.click({ item: 6, priv: 0, post_type: 2 })" title="">improve this answer</a>
        <span class="lsep">|</span>
    <button id="btnFollowPost-1401502" class="s-btn s-btn__link fc-black-400 h:fc-black-700 pb2 js-follow-post js-follow-answer js-gps-track" role="button"
            data-gps-track="post.click({ item: 14, priv: 0, post_type: 2 })"
            data-controller="s-tooltip " data-s-tooltip-placement="bottom"
            data-s-popover-placement="bottom" aria-controls=""
            title="Follow this answer to receive notifications">
        follow
    </button>
        <span class="lsep">|</span>
</div>

        </div>


    <div class="post-signature grid--cell fl0">
        <div class="user-info ">
    <div class="user-action-time">
        answered <span title="2009-09-09 19:11:01Z" class="relativetime">Sep 9 '09 at 19:11</span>
    </div>
    <div class="user-gravatar32">
        <a href="/users/115738/kwatford"><div class="gravatar-wrapper-32"><img src="https://www.gravatar.com/avatar/677c07bc6ae25d8b00af5be67c530023?s=32&amp;d=identicon&amp;r=PG" alt="" width="32" height="32" class="bar-sm"></div></a>
    </div>
    <div class="user-details" itemprop="author" itemscope itemtype="http://schema.org/Person">
        <a href="/users/115738/kwatford">kwatford</a><span class="d-none" itemprop="name">kwatford</span>
        <div class="-flair">
            <span class="reputation-score" title="reputation score 19,750" dir="ltr">19.8k</span><span title="2 gold badges" aria-hidden="true"><span class="badge1"></span><span class="badgecount">2</span></span><span class="v-visible-sr">2 gold badges</span><span title="36 silver badges" aria-hidden="true"><span class="badge2"></span><span class="badgecount">36</span></span><span class="v-visible-sr">36 silver badges</span><span title="60 bronze badges" aria-hidden="true"><span class="badge3"></span><span class="badgecount">60</span></span><span class="v-visible-sr">60 bronze badges</span>
        </div>
    </div>
</div>

    </div>
    </div>
    
</div>


                <div class="post-layout--right">
        <div id="comments-1401502" class="comments js-comments-container bt bc-black-2 mt12 " data-post-id="1401502" data-min-length="15">
            <ul class="comments-list js-comments-list"
                    data-remaining-comments-count="0"
                    data-canpost="false"
                    data-cansee="true"
                    data-comments-unavailable="false"
                    data-addlink-disabled="true">

                        <li id="comment-55256871" class="comment js-comment " data-comment-id="55256871">
        <div class="js-comment-actions comment-actions">
            <div class="comment-score js-comment-edit-hide">
                    <span title="number of &#x27;useful comment&#x27; votes received"
                            class="warm">12</span>
            </div>
        </div>
        <div class="comment-text js-comment-text-and-form">
            <div class="comment-body js-comment-edit-hide">
                
                <span class="comment-copy">The man pages for date reads: %F full date; same as %Y-%m-%d, so this is just a more compact notation for the accepted answer.</span>
                
&ndash;&nbsp;<a href="/users/838608/h%c3%a5vard-geithus"
                       title="4,967 reputation"
                       class="comment-user">H&#xE5;vard Geithus</a>
                <span class="comment-date" dir="ltr"><span title="2015-11-16 20:42:14Z, License: CC BY-SA 3.0" class="relativetime-clean">Nov 16 '15 at 20:42</span></span>
                        <span title="this comment was edited 2 times">
                            <svg aria-hidden="true" class="va-text-bottom o50 svg-icon iconPencilSm" width="14" height="14" viewBox="0 0 14 14"><path d="M11.1 1.71l1.13 1.12c.2.2.2.51 0 .71L11.1 4.7 9.21 2.86l1.17-1.15c.2-.2.51-.2.71 0zM2 10.12l6.37-6.43 1.88 1.88L3.88 12H2v-1.88z"/></svg>
                        </span>
            </div>
        </div>
    </li>

            </ul>
	    </div>

        <div id="comments-link-1401502" data-rep=50 data-anon=true>
                    <a class="js-add-link comments-link disabled-link" title="Use comments to ask for more information or suggest improvements. Say thanks by reacting to the answer."  href="#" role="button">add a comment</a>
                <span class="js-link-separator dno">&nbsp;|&nbsp;</span>
            <a class="js-show-link comments-link dno" title="expand to show all comments on this post" href=# onclick="" role="button"></a>
        </div>         
    </div>
    </div>
</div>

                                          
<a name="1401490"></a>
<div id="answer-1401490" class="answer" data-answerid="1401490"  itemprop="suggestedAnswer" itemscope itemtype="http://schema.org/Answer">
    <div class="post-layout">
        <div class="votecell post-layout--left">
            <div class="js-voting-container grid fd-column ai-stretch gs4 fc-black-200" data-post-id="1401490">
        <button class="js-vote-up-btn grid--cell s-btn s-btn__unset c-pointer" data-controller="s-tooltip" data-s-tooltip-placement="right" title="Upvote this answer if you find it clear and useful." aria-pressed="false" aria-label="Up vote" data-selected-classes="fc-theme-primary"><svg aria-hidden="true" class="m0 svg-icon iconArrowUpLg" width="36" height="36" viewBox="0 0 36 36"><path d="M2 26h32L18 10 2 26z"/></svg></button>
        <div class="js-vote-count grid--cell fc-black-500 fs-title grid fd-column ai-center" itemprop="upvoteCount" data-value="93">93</div>
        <button class="js-vote-down-btn grid--cell s-btn s-btn__unset c-pointer" data-controller="s-tooltip" data-s-tooltip-placement="right" title="Downvote this answer if you find it unclear or not useful." aria-pressed="false" aria-label="Down vote" data-selected-classes="fc-theme-primary"><svg aria-hidden="true" class="m0 svg-icon iconArrowDownLg" width="36" height="36" viewBox="0 0 36 36"><path d="M2 10h32L18 26 2 10z"/></svg></button>

    
            <div class="js-accepted-answer-indicator grid--cell fc-green-500 ta-center py4 d-none" data-s-tooltip-placement="right" title="Loading when this answer was accepted&#x2026;" tabindex="0" role="note" aria-label="Accepted">
                <svg aria-hidden="true" class="svg-icon iconCheckmarkLg" width="36" height="36" viewBox="0 0 36 36"><path d="M6 14l8 8L30 6v8L14 30l-8-8v-8z"/></svg>
            </div>

        
<div class="js-reactions grid--cell"
     data-controller="reactions"
     data-count="0"
     data-action="post:reactionsInit->reactions#updateUI">
        <button class="s-btn s-btn__unset w100 py4 c-pointer" aria-label="Thanks (0)" data-target="reactions.button" data-action="reactions#tryToggle keypress->reactions#tryToggle" aria-pressed="false"
                data-controller="s-tooltip" data-s-tooltip-placement="right" data-s-tooltip-html-title="Say &lt;b&gt;thanks&lt;/b&gt; for this answer."><svg aria-hidden="true" class="svg-icon iconHandsTogether" width="18" height="18" viewBox="0 0 18 18"><path d="M3.85 1.15a.5.5 0 10-.7.7l2 2a.5.5 0 10.7-.7l-2-2zM5.5 6h-2a.5.5 0 000 1h2a.5.5 0 000-1zm10 1h-2a.5.5 0 010-1h2a.5.5 0 010 1zm.35-5.15a.5.5 0 00-.7-.7l-2 2a.5.5 0 00.7.7l2-2z" opacity=".4"/><path d="M8.21 16.49c-.44.37-1.02.55-1.6.51H5v-6h2l1-7.63c0-.2.23-.37.5-.37s.5.17.5.37V15a2.23 2.23 0 01-.79 1.49zm2.58 0c.44.37 1.02.55 1.6.51H14v-6h-2l-1-7.63c0-.2-.23-.37-.5-.37s-.5.17-.5.37V15c.06.58.34 1.11.79 1.49z" fill="#FFC166"/><path d="M2.5 11c-.83 0-1.5.67-1.5 1.5v3c0 .83.67 1.5 1.5 1.5H4v-6H2.5zm14 0H15v6h1.5c.83 0 1.5-.67 1.5-1.5v-3c0-.83-.67-1.5-1.5-1.5z" opacity=".7" fill="#07C"/></svg></button>
        <div class="ta-center fc-black-200 d-none" data-target="reactions.count"
             data-controller="s-tooltip" data-s-tooltip-placement="right" data-s-tooltip-html-title="0 others reacted with &lt;b&gt;thanks&lt;/b&gt;.">0</div>
</div>

    
        <a class="js-post-issue grid--cell s-btn s-btn__unset c-pointer py6 mx-auto" href="/posts/1401490/timeline" data-shortcut="T" data-controller="s-tooltip" data-s-tooltip-placement="right" title="Show activity on this post." aria-label="Timeline"><svg aria-hidden="true" class="mln2 mr0 svg-icon iconHistory" width="19" height="18" viewBox="0 0 19 18"><path d="M3 9a8 8 0 113.73 6.77L8.2 14.3A6 6 0 105 9l3.01-.01-4 4-4-4h3L3 9zm7-4h1.01L11 9.36l3.22 2.1-.6.93L10 10V5z"/></svg></a>

</div>

        </div>

        

<div class="answercell post-layout--right">
    
    <div class="post-text" itemprop="text">
<p>You can do something like this:</p>

<pre><code>$ date +'%Y-%m-%d'
</code></pre>
    </div>
    <div class="grid mb0 fw-wrap ai-start jc-end gs8 gsy">
        <time itemprop="dateCreated" datetime="2009-09-09T19:08:32"></time>
        <div class="grid--cell mr16" style="flex: 1 1 100px;">
            

<div class="post-menu">
    <a href="/a/1401490"
       rel="nofollow"
       itemprop="url"
       class="js-share-link js-gps-track"
       title="short permalink to this answer"
       data-gps-track="post.click({ item: 2, priv: 0, post_type: 2 })"
       data-controller="se-share-sheet"
       data-se-share-sheet-title="Share a link to this answer"
       data-se-share-sheet-subtitle=""
       data-se-share-sheet-post-type="answer"
       data-se-share-sheet-social="facebook twitter devto"
       data-se-share-sheet-location="2"
       data-se-share-sheet-license-url="https%3a%2f%2fcreativecommons.org%2flicenses%2fby-sa%2f3.0%2f"
       data-se-share-sheet-license-name="CC BY-SA 3.0"
       data-s-popover-placement="bottom-start">share</a>
        <span class="lsep">|</span>
                <a href="/posts/1401490/edit" class="suggest-edit-post js-gps-track" data-gps-track="post.click({ item: 6, priv: 0, post_type: 2 })" title="">improve this answer</a>
        <span class="lsep">|</span>
    <button id="btnFollowPost-1401490" class="s-btn s-btn__link fc-black-400 h:fc-black-700 pb2 js-follow-post js-follow-answer js-gps-track" role="button"
            data-gps-track="post.click({ item: 14, priv: 0, post_type: 2 })"
            data-controller="s-tooltip " data-s-tooltip-placement="bottom"
            data-s-popover-placement="bottom" aria-controls=""
            title="Follow this answer to receive notifications">
        follow
    </button>
        <span class="lsep">|</span>
</div>

        </div>
    <div class="post-signature grid--cell fl0">
<div class="user-info user-hover">
    <div class="user-action-time">
        <a href="/posts/1401490/revisions" title="show all edits to this post"
                         class="js-gps-track"
                         data-gps-track="post.click({ item: 4, priv: 0, post_type: 2 })">edited <span title="2013-10-14 21:29:54Z" class="relativetime">Oct 14 '13 at 21:29</span></a>
    </div>
    <div class="user-gravatar32">
        <a href="/users/1849664/undo"><div class="gravatar-wrapper-32"><img src="https://www.gravatar.com/avatar/9278dc00e1a8755dc2de02b6a908a15a?s=32&amp;d=identicon&amp;r=PG" alt="" width="32" height="32" class="bar-sm"></div></a>
    </div>
    <div class="user-details">
        <a href="/users/1849664/undo">Undo</a><span class="mod-flair " title="moderator">&#9830;</span>
        <div class="-flair">
            <span class="reputation-score" title="reputation score 24,918" dir="ltr">24.9k</span><span title="21 gold badges" aria-hidden="true"><span class="badge1"></span><span class="badgecount">21</span></span><span class="v-visible-sr">21 gold badges</span><span title="97 silver badges" aria-hidden="true"><span class="badge2"></span><span class="badgecount">97</span></span><span class="v-visible-sr">97 silver badges</span><span title="122 bronze badges" aria-hidden="true"><span class="badge3"></span><span class="badgecount">122</span></span><span class="v-visible-sr">122 bronze badges</span>
        </div>
    </div>
</div>    </div>


    <div class="post-signature grid--cell fl0">
        <div class="user-info ">
    <div class="user-action-time">
        answered <span title="2009-09-09 19:08:32Z" class="relativetime">Sep 9 '09 at 19:08</span>
    </div>
    <div class="user-gravatar32">
        <span class="anonymous-gravatar"></span>
    </div>
    <div class="user-details" itemprop="author" itemscope itemtype="http://schema.org/Person">
        lutz<span class="d-none" itemprop="name">lutz</span>
        <div class="-flair">
            
        </div>
    </div>
</div>

    </div>
    </div>
    
</div>


                <div class="post-layout--right">
        <div id="comments-1401490" class="comments js-comments-container bt bc-black-2 mt12  dno" data-post-id="1401490" data-min-length="15">
            <ul class="comments-list js-comments-list"
                    data-remaining-comments-count="0"
                    data-canpost="false"
                    data-cansee="true"
                    data-comments-unavailable="false"
                    data-addlink-disabled="true">

            </ul>
	    </div>

        <div id="comments-link-1401490" data-rep=50 data-anon=true>
                    <a class="js-add-link comments-link disabled-link" title="Use comments to ask for more information or suggest improvements. Say thanks by reacting to the answer."  href="#" role="button">add a comment</a>
                <span class="js-link-separator dno">&nbsp;|&nbsp;</span>
            <a class="js-show-link comments-link dno" title="expand to show all comments on this post" href=# onclick="" role="button"></a>
        </div>         
    </div>
    </div>
</div>

<div id="dfp-smlb" class="everyonelovesstackoverflow everyoneloves__mid-second-leaderboard my8 mx-auto"></div>
                                          
<a name="17195700"></a>
<div id="answer-17195700" class="answer" data-answerid="17195700"  itemprop="suggestedAnswer" itemscope itemtype="http://schema.org/Answer">
    <div class="post-layout">
        <div class="votecell post-layout--left">
            <div class="js-voting-container grid fd-column ai-stretch gs4 fc-black-200" data-post-id="17195700">
        <button class="js-vote-up-btn grid--cell s-btn s-btn__unset c-pointer" data-controller="s-tooltip" data-s-tooltip-placement="right" title="Upvote this answer if you find it clear and useful." aria-pressed="false" aria-label="Up vote" data-selected-classes="fc-theme-primary"><svg aria-hidden="true" class="m0 svg-icon iconArrowUpLg" width="36" height="36" viewBox="0 0 36 36"><path d="M2 26h32L18 10 2 26z"/></svg></button>
        <div class="js-vote-count grid--cell fc-black-500 fs-title grid fd-column ai-center" itemprop="upvoteCount" data-value="47">47</div>
        <button class="js-vote-down-btn grid--cell s-btn s-btn__unset c-pointer" data-controller="s-tooltip" data-s-tooltip-placement="right" title="Downvote this answer if you find it unclear or not useful." aria-pressed="false" aria-label="Down vote" data-selected-classes="fc-theme-primary"><svg aria-hidden="true" class="m0 svg-icon iconArrowDownLg" width="36" height="36" viewBox="0 0 36 36"><path d="M2 10h32L18 26 2 10z"/></svg></button>

    
            <div class="js-accepted-answer-indicator grid--cell fc-green-500 ta-center py4 d-none" data-s-tooltip-placement="right" title="Loading when this answer was accepted&#x2026;" tabindex="0" role="note" aria-label="Accepted">
                <svg aria-hidden="true" class="svg-icon iconCheckmarkLg" width="36" height="36" viewBox="0 0 36 36"><path d="M6 14l8 8L30 6v8L14 30l-8-8v-8z"/></svg>
            </div>

        
<div class="js-reactions grid--cell"
     data-controller="reactions"
     data-count="0"
     data-action="post:reactionsInit->reactions#updateUI">
        <button class="s-btn s-btn__unset w100 py4 c-pointer" aria-label="Thanks (0)" data-target="reactions.button" data-action="reactions#tryToggle keypress->reactions#tryToggle" aria-pressed="false"
                data-controller="s-tooltip" data-s-tooltip-placement="right" data-s-tooltip-html-title="Say &lt;b&gt;thanks&lt;/b&gt; for this answer."><svg aria-hidden="true" class="svg-icon iconHandsTogether" width="18" height="18" viewBox="0 0 18 18"><path d="M3.85 1.15a.5.5 0 10-.7.7l2 2a.5.5 0 10.7-.7l-2-2zM5.5 6h-2a.5.5 0 000 1h2a.5.5 0 000-1zm10 1h-2a.5.5 0 010-1h2a.5.5 0 010 1zm.35-5.15a.5.5 0 00-.7-.7l-2 2a.5.5 0 00.7.7l2-2z" opacity=".4"/><path d="M8.21 16.49c-.44.37-1.02.55-1.6.51H5v-6h2l1-7.63c0-.2.23-.37.5-.37s.5.17.5.37V15a2.23 2.23 0 01-.79 1.49zm2.58 0c.44.37 1.02.55 1.6.51H14v-6h-2l-1-7.63c0-.2-.23-.37-.5-.37s-.5.17-.5.37V15c.06.58.34 1.11.79 1.49z" fill="#FFC166"/><path d="M2.5 11c-.83 0-1.5.67-1.5 1.5v3c0 .83.67 1.5 1.5 1.5H4v-6H2.5zm14 0H15v6h1.5c.83 0 1.5-.67 1.5-1.5v-3c0-.83-.67-1.5-1.5-1.5z" opacity=".7" fill="#07C"/></svg></button>
        <div class="ta-center fc-black-200 d-none" data-target="reactions.count"
             data-controller="s-tooltip" data-s-tooltip-placement="right" data-s-tooltip-html-title="0 others reacted with &lt;b&gt;thanks&lt;/b&gt;.">0</div>
</div>

    
        <a class="js-post-issue grid--cell s-btn s-btn__unset c-pointer py6 mx-auto" href="/posts/17195700/timeline" data-shortcut="T" data-controller="s-tooltip" data-s-tooltip-placement="right" title="Show activity on this post." aria-label="Timeline"><svg aria-hidden="true" class="mln2 mr0 svg-icon iconHistory" width="19" height="18" viewBox="0 0 19 18"><path d="M3 9a8 8 0 113.73 6.77L8.2 14.3A6 6 0 105 9l3.01-.01-4 4-4-4h3L3 9zm7-4h1.01L11 9.36l3.22 2.1-.6.93L10 10V5z"/></svg></a>

</div>

        </div>

        

<div class="answercell post-layout--right">
    
    <div class="post-text" itemprop="text">
<p>You're looking for <a href="http://en.wikipedia.org/wiki/ISO_8601">ISO 8601</a> standard date format, so if you have GNU date (or any date command more modern than 1988) just do: <code>$(date -I)</code></p>
    </div>
    <div class="grid mb0 fw-wrap ai-start jc-end gs8 gsy">
        <time itemprop="dateCreated" datetime="2013-06-19T15:49:39"></time>
        <div class="grid--cell mr16" style="flex: 1 1 100px;">
            

<div class="post-menu">
    <a href="/a/17195700"
       rel="nofollow"
       itemprop="url"
       class="js-share-link js-gps-track"
       title="short permalink to this answer"
       data-gps-track="post.click({ item: 2, priv: 0, post_type: 2 })"
       data-controller="se-share-sheet"
       data-se-share-sheet-title="Share a link to this answer"
       data-se-share-sheet-subtitle=""
       data-se-share-sheet-post-type="answer"
       data-se-share-sheet-social="facebook twitter devto"
       data-se-share-sheet-location="2"
       data-se-share-sheet-license-url="https%3a%2f%2fcreativecommons.org%2flicenses%2fby-sa%2f3.0%2f"
       data-se-share-sheet-license-name="CC BY-SA 3.0"
       data-s-popover-placement="bottom-start">share</a>
        <span class="lsep">|</span>
                <a href="/posts/17195700/edit" class="suggest-edit-post js-gps-track" data-gps-track="post.click({ item: 6, priv: 0, post_type: 2 })" title="">improve this answer</a>
        <span class="lsep">|</span>
    <button id="btnFollowPost-17195700" class="s-btn s-btn__link fc-black-400 h:fc-black-700 pb2 js-follow-post js-follow-answer js-gps-track" role="button"
            data-gps-track="post.click({ item: 14, priv: 0, post_type: 2 })"
            data-controller="s-tooltip " data-s-tooltip-placement="bottom"
            data-s-popover-placement="bottom" aria-controls=""
            title="Follow this answer to receive notifications">
        follow
    </button>
        <span class="lsep">|</span>
</div>

        </div>
    <div class="post-signature grid--cell fl0">
<div class="user-info user-hover">
    <div class="user-action-time">
        <a href="/posts/17195700/revisions" title="show all edits to this post"
                         class="js-gps-track"
                         data-gps-track="post.click({ item: 4, priv: 0, post_type: 2 })">edited <span title="2014-05-03 04:26:02Z" class="relativetime">May 3 '14 at 4:26</span></a>
    </div>
    <div class="user-gravatar32">
        <a href="/users/642706/basil-bourque"><div class="gravatar-wrapper-32"><img src="https://i.stack.imgur.com/ZWEI3.jpg?s=32&amp;g=1" alt="" width="32" height="32" class="bar-sm"></div></a>
    </div>
    <div class="user-details">
        <a href="/users/642706/basil-bourque">Basil Bourque</a>
        <div class="-flair">
            <span class="reputation-score" title="reputation score 174,410" dir="ltr">174k</span><span title="48 gold badges" aria-hidden="true"><span class="badge1"></span><span class="badgecount">48</span></span><span class="v-visible-sr">48 gold badges</span><span title="547 silver badges" aria-hidden="true"><span class="badge2"></span><span class="badgecount">547</span></span><span class="v-visible-sr">547 silver badges</span><span title="767 bronze badges" aria-hidden="true"><span class="badge3"></span><span class="badgecount">767</span></span><span class="v-visible-sr">767 bronze badges</span>
        </div>
    </div>
</div>    </div>


    <div class="post-signature grid--cell fl0">
        <div class="user-info user-hover">
    <div class="user-action-time">
        answered <span title="2013-06-19 15:49:39Z" class="relativetime">Jun 19 '13 at 15:49</span>
    </div>
    <div class="user-gravatar32">
        <a href="/users/2300151/medievalist"><div class="gravatar-wrapper-32"><img src="https://i.stack.imgur.com/o7Vid.png?s=32&amp;g=1" alt="" width="32" height="32" class="bar-sm"></div></a>
    </div>
    <div class="user-details" itemprop="author" itemscope itemtype="http://schema.org/Person">
        <a href="/users/2300151/medievalist">Medievalist</a><span class="d-none" itemprop="name">Medievalist</span>
        <div class="-flair">
            <span class="reputation-score" title="reputation score " dir="ltr">613</span><span title="5 silver badges" aria-hidden="true"><span class="badge2"></span><span class="badgecount">5</span></span><span class="v-visible-sr">5 silver badges</span><span title="8 bronze badges" aria-hidden="true"><span class="badge3"></span><span class="badgecount">8</span></span><span class="v-visible-sr">8 bronze badges</span>
        </div>
    </div>
</div>

    </div>
    </div>
    
</div>


                <div class="post-layout--right">
        <div id="comments-17195700" class="comments js-comments-container bt bc-black-2 mt12 " data-post-id="17195700" data-min-length="15">
            <ul class="comments-list js-comments-list"
                    data-remaining-comments-count="0"
                    data-canpost="false"
                    data-cansee="true"
                    data-comments-unavailable="false"
                    data-addlink-disabled="true">

                        <li id="comment-27036985" class="comment js-comment " data-comment-id="27036985">
        <div class="js-comment-actions comment-actions">
            <div class="comment-score js-comment-edit-hide">
                    <span title="number of &#x27;useful comment&#x27; votes received"
                            class="warm">9</span>
            </div>
        </div>
        <div class="comment-text js-comment-text-and-form">
            <div class="comment-body js-comment-edit-hide">
                
                <span class="comment-copy">I have a recent (&gt;1988) Mac OS X computer, and <code>date -I</code> didn&#39;t work. Having installed <a href="http://www.gnu.org/software/coreutils" rel="nofollow noreferrer">GNU coreutils</a> using <a href="http://brew.sh/" rel="nofollow noreferrer">brew</a> (which uses the prefix &#39;g&#39;) <code>gdate -I</code> did work.</span>
                
&ndash;&nbsp;<a href="/users/907779/joel-purra"
                       title="19,152 reputation"
                       class="comment-user">Joel Purra</a>
                <span class="comment-date" dir="ltr"><span title="2013-08-23 15:47:41Z, License: CC BY-SA 3.0" class="relativetime-clean">Aug 23 '13 at 15:47</span></span>
            </div>
        </div>
    </li>
    <li id="comment-28703816" class="comment js-comment " data-comment-id="28703816">
        <div class="js-comment-actions comment-actions">
            <div class="comment-score js-comment-edit-hide">
                    <span title="number of &#x27;useful comment&#x27; votes received"
                            class="cool">3</span>
            </div>
        </div>
        <div class="comment-text js-comment-text-and-form">
            <div class="comment-body js-comment-edit-hide">
                
                <span class="comment-copy">Odd. I can&#39;t find the <code>-I</code> option documented for GNU <code>date</code>, although sure enough it does seem to be equivalent to <code>date +%F</code>.</span>
                
&ndash;&nbsp;<a href="/users/1126841/chepner"
                       title="340,257 reputation"
                       class="comment-user">chepner</a>
                <span class="comment-date" dir="ltr"><span title="2013-10-14 21:55:53Z, License: CC BY-SA 3.0" class="relativetime-clean">Oct 14 '13 at 21:55</span></span>
            </div>
        </div>
    </li>
    <li id="comment-30861106" class="comment js-comment " data-comment-id="30861106">
        <div class="js-comment-actions comment-actions">
            <div class="comment-score js-comment-edit-hide">
                    <span title="number of &#x27;useful comment&#x27; votes received"
                            class="cool">3</span>
            </div>
        </div>
        <div class="comment-text js-comment-text-and-form">
            <div class="comment-body js-comment-edit-hide">
                
                <span class="comment-copy">OS X is generally a GPL v3 wasteland, so they might just not have updated date or BASH recently.</span>
                
&ndash;&nbsp;<a href="/users/328144/indolering"
                       title="2,775 reputation"
                       class="comment-user">Indolering</a>
                <span class="comment-date" dir="ltr"><span title="2013-12-16 20:50:20Z, License: CC BY-SA 3.0" class="relativetime-clean">Dec 16 '13 at 20:50</span></span>
            </div>
        </div>
    </li>

            </ul>
	    </div>

        <div id="comments-link-17195700" data-rep=50 data-anon=true>
                    <a class="js-add-link comments-link disabled-link" title="Use comments to ask for more information or suggest improvements. Say thanks by reacting to the answer."  href="#" role="button">add a comment</a>
                <span class="js-link-separator dno">&nbsp;|&nbsp;</span>
            <a class="js-show-link comments-link dno" title="expand to show all comments on this post" href=# onclick="" role="button"></a>
        </div>         
    </div>
    </div>
</div>

                                          
<a name="32433845"></a>
<div id="answer-32433845" class="answer" data-answerid="32433845"  itemprop="suggestedAnswer" itemscope itemtype="http://schema.org/Answer">
    <div class="post-layout">
        <div class="votecell post-layout--left">
            <div class="js-voting-container grid fd-column ai-stretch gs4 fc-black-200" data-post-id="32433845">
        <button class="js-vote-up-btn grid--cell s-btn s-btn__unset c-pointer" data-controller="s-tooltip" data-s-tooltip-placement="right" title="Upvote this answer if you find it clear and useful." aria-pressed="false" aria-label="Up vote" data-selected-classes="fc-theme-primary"><svg aria-hidden="true" class="m0 svg-icon iconArrowUpLg" width="36" height="36" viewBox="0 0 36 36"><path d="M2 26h32L18 10 2 26z"/></svg></button>
        <div class="js-vote-count grid--cell fc-black-500 fs-title grid fd-column ai-center" itemprop="upvoteCount" data-value="20">20</div>
        <button class="js-vote-down-btn grid--cell s-btn s-btn__unset c-pointer" data-controller="s-tooltip" data-s-tooltip-placement="right" title="Downvote this answer if you find it unclear or not useful." aria-pressed="false" aria-label="Down vote" data-selected-classes="fc-theme-primary"><svg aria-hidden="true" class="m0 svg-icon iconArrowDownLg" width="36" height="36" viewBox="0 0 36 36"><path d="M2 10h32L18 26 2 10z"/></svg></button>

    
            <div class="js-accepted-answer-indicator grid--cell fc-green-500 ta-center py4 d-none" data-s-tooltip-placement="right" title="Loading when this answer was accepted&#x2026;" tabindex="0" role="note" aria-label="Accepted">
                <svg aria-hidden="true" class="svg-icon iconCheckmarkLg" width="36" height="36" viewBox="0 0 36 36"><path d="M6 14l8 8L30 6v8L14 30l-8-8v-8z"/></svg>
            </div>

        
<div class="js-reactions grid--cell"
     data-controller="reactions"
     data-count="0"
     data-action="post:reactionsInit->reactions#updateUI">
        <button class="s-btn s-btn__unset w100 py4 c-pointer" aria-label="Thanks (0)" data-target="reactions.button" data-action="reactions#tryToggle keypress->reactions#tryToggle" aria-pressed="false"
                data-controller="s-tooltip" data-s-tooltip-placement="right" data-s-tooltip-html-title="Say &lt;b&gt;thanks&lt;/b&gt; for this answer."><svg aria-hidden="true" class="svg-icon iconHandsTogether" width="18" height="18" viewBox="0 0 18 18"><path d="M3.85 1.15a.5.5 0 10-.7.7l2 2a.5.5 0 10.7-.7l-2-2zM5.5 6h-2a.5.5 0 000 1h2a.5.5 0 000-1zm10 1h-2a.5.5 0 010-1h2a.5.5 0 010 1zm.35-5.15a.5.5 0 00-.7-.7l-2 2a.5.5 0 00.7.7l2-2z" opacity=".4"/><path d="M8.21 16.49c-.44.37-1.02.55-1.6.51H5v-6h2l1-7.63c0-.2.23-.37.5-.37s.5.17.5.37V15a2.23 2.23 0 01-.79 1.49zm2.58 0c.44.37 1.02.55 1.6.51H14v-6h-2l-1-7.63c0-.2-.23-.37-.5-.37s-.5.17-.5.37V15c.06.58.34 1.11.79 1.49z" fill="#FFC166"/><path d="M2.5 11c-.83 0-1.5.67-1.5 1.5v3c0 .83.67 1.5 1.5 1.5H4v-6H2.5zm14 0H15v6h1.5c.83 0 1.5-.67 1.5-1.5v-3c0-.83-.67-1.5-1.5-1.5z" opacity=".7" fill="#07C"/></svg></button>
        <div class="ta-center fc-black-200 d-none" data-target="reactions.count"
             data-controller="s-tooltip" data-s-tooltip-placement="right" data-s-tooltip-html-title="0 others reacted with &lt;b&gt;thanks&lt;/b&gt;.">0</div>
</div>

    
        <a class="js-post-issue grid--cell s-btn s-btn__unset c-pointer py6 mx-auto" href="/posts/32433845/timeline" data-shortcut="T" data-controller="s-tooltip" data-s-tooltip-placement="right" title="Show activity on this post." aria-label="Timeline"><svg aria-hidden="true" class="mln2 mr0 svg-icon iconHistory" width="19" height="18" viewBox="0 0 19 18"><path d="M3 9a8 8 0 113.73 6.77L8.2 14.3A6 6 0 105 9l3.01-.01-4 4-4-4h3L3 9zm7-4h1.01L11 9.36l3.22 2.1-.6.93L10 10V5z"/></svg></a>

</div>

        </div>

        

<div class="answercell post-layout--right">
    
    <div class="post-text" itemprop="text">
<pre><code>date -d '1 hour ago' '+%Y-%m-%d'
</code></pre>

<p>The output would be <code>2015-06-14</code>.</p>
    </div>
    <div class="grid mb0 fw-wrap ai-start jc-end gs8 gsy">
        <time itemprop="dateCreated" datetime="2015-09-07T08:05:22"></time>
        <div class="grid--cell mr16" style="flex: 1 1 100px;">
            

<div class="post-menu">
    <a href="/a/32433845"
       rel="nofollow"
       itemprop="url"
       class="js-share-link js-gps-track"
       title="short permalink to this answer"
       data-gps-track="post.click({ item: 2, priv: 0, post_type: 2 })"
       data-controller="se-share-sheet"
       data-se-share-sheet-title="Share a link to this answer"
       data-se-share-sheet-subtitle=""
       data-se-share-sheet-post-type="answer"
       data-se-share-sheet-social="facebook twitter devto"
       data-se-share-sheet-location="2"
       data-se-share-sheet-license-url="https%3a%2f%2fcreativecommons.org%2flicenses%2fby-sa%2f3.0%2f"
       data-se-share-sheet-license-name="CC BY-SA 3.0"
       data-s-popover-placement="bottom-start">share</a>
        <span class="lsep">|</span>
                <a href="/posts/32433845/edit" class="suggest-edit-post js-gps-track" data-gps-track="post.click({ item: 6, priv: 0, post_type: 2 })" title="">improve this answer</a>
        <span class="lsep">|</span>
    <button id="btnFollowPost-32433845" class="s-btn s-btn__link fc-black-400 h:fc-black-700 pb2 js-follow-post js-follow-answer js-gps-track" role="button"
            data-gps-track="post.click({ item: 14, priv: 0, post_type: 2 })"
            data-controller="s-tooltip " data-s-tooltip-placement="bottom"
            data-s-popover-placement="bottom" aria-controls=""
            title="Follow this answer to receive notifications">
        follow
    </button>
        <span class="lsep">|</span>
</div>

        </div>
    <div class="post-signature grid--cell fl0">
<div class="user-info user-hover">
    <div class="user-action-time">
        <a href="/posts/32433845/revisions" title="show all edits to this post"
                         class="js-gps-track"
                         data-gps-track="post.click({ item: 4, priv: 0, post_type: 2 })">edited <span title="2016-06-14 14:45:33Z" class="relativetime">Jun 14 '16 at 14:45</span></a>
    </div>
    <div class="user-gravatar32">
        <a href="/users/4850040/toby-speight"><div class="gravatar-wrapper-32"><img src="https://i.stack.imgur.com/acYd0.png?s=32&amp;g=1" alt="" width="32" height="32" class="bar-sm"></div></a>
    </div>
    <div class="user-details">
        <a href="/users/4850040/toby-speight">Toby Speight</a>
        <div class="-flair">
            <span class="reputation-score" title="reputation score 21,593" dir="ltr">21.6k</span><span title="13 gold badges" aria-hidden="true"><span class="badge1"></span><span class="badgecount">13</span></span><span class="v-visible-sr">13 gold badges</span><span title="53 silver badges" aria-hidden="true"><span class="badge2"></span><span class="badgecount">53</span></span><span class="v-visible-sr">53 silver badges</span><span title="76 bronze badges" aria-hidden="true"><span class="badge3"></span><span class="badgecount">76</span></span><span class="v-visible-sr">76 bronze badges</span>
        </div>
    </div>
</div>    </div>


    <div class="post-signature grid--cell fl0">
        <div class="user-info ">
    <div class="user-action-time">
        answered <span title="2015-09-07 08:05:22Z" class="relativetime">Sep 7 '15 at 8:05</span>
    </div>
    <div class="user-gravatar32">
        <a href="/users/1494469/xu2mao"><div class="gravatar-wrapper-32"><img src="https://www.gravatar.com/avatar/9eda0a2655f188d85ebc1e59d4567e45?s=32&amp;d=identicon&amp;r=PG" alt="" width="32" height="32" class="bar-sm"></div></a>
    </div>
    <div class="user-details" itemprop="author" itemscope itemtype="http://schema.org/Person">
        <a href="/users/1494469/xu2mao">xu2mao</a><span class="d-none" itemprop="name">xu2mao</span>
        <div class="-flair">
            <span class="reputation-score" title="reputation score " dir="ltr">465</span><span title="4 silver badges" aria-hidden="true"><span class="badge2"></span><span class="badgecount">4</span></span><span class="v-visible-sr">4 silver badges</span><span title="8 bronze badges" aria-hidden="true"><span class="badge3"></span><span class="badgecount">8</span></span><span class="v-visible-sr">8 bronze badges</span>
        </div>
    </div>
</div>

    </div>
    </div>
    
</div>


                <div class="post-layout--right">
        <div id="comments-32433845" class="comments js-comments-container bt bc-black-2 mt12 " data-post-id="32433845" data-min-length="15">
            <ul class="comments-list js-comments-list"
                    data-remaining-comments-count="0"
                    data-canpost="false"
                    data-cansee="true"
                    data-comments-unavailable="false"
                    data-addlink-disabled="true">

                        <li id="comment-60985348" class="comment js-comment " data-comment-id="60985348">
        <div class="js-comment-actions comment-actions">
            <div class="comment-score js-comment-edit-hide">
                    <span title="number of &#x27;useful comment&#x27; votes received"
                            class="cool">3</span>
            </div>
        </div>
        <div class="comment-text js-comment-text-and-form">
            <div class="comment-body js-comment-edit-hide">
                
                <span class="comment-copy">Wrong for a couple of reasons, obviously this gives the wrong date between 00:00 and 01:00, and besides you end with a <code>%</code>.</span>
                
&ndash;&nbsp;<a href="/users/1439843/gerhard-burger"
                       title="1,016 reputation"
                       class="comment-user">Gerhard Burger</a>
                <span class="comment-date" dir="ltr"><span title="2016-04-18 15:50:24Z, License: CC BY-SA 3.0" class="relativetime-clean">Apr 18 '16 at 15:50</span></span>
            </div>
        </div>
    </li>
    <li id="comment-77649827" class="comment js-comment " data-comment-id="77649827">
        <div class="js-comment-actions comment-actions">
            <div class="comment-score js-comment-edit-hide">
            </div>
        </div>
        <div class="comment-text js-comment-text-and-form">
            <div class="comment-body js-comment-edit-hide">
                
                <span class="comment-copy">it&#39;s not true. should be like this  sparse single quote</span>
                
&ndash;&nbsp;<a href="/users/5448552/beyhan-g%c3%bcl"
                       title="939 reputation"
                       class="comment-user">Beyhan G&#xFC;l</a>
                <span class="comment-date" dir="ltr"><span title="2017-07-27 07:38:02Z, License: CC BY-SA 3.0" class="relativetime-clean">Jul 27 '17 at 7:38</span></span>
                        <span title="this comment was edited 1 time">
                            <svg aria-hidden="true" class="va-text-bottom o50 svg-icon iconPencilSm" width="14" height="14" viewBox="0 0 14 14"><path d="M11.1 1.71l1.13 1.12c.2.2.2.51 0 .71L11.1 4.7 9.21 2.86l1.17-1.15c.2-.2.51-.2.71 0zM2 10.12l6.37-6.43 1.88 1.88L3.88 12H2v-1.88z"/></svg>
                        </span>
            </div>
        </div>
    </li>

            </ul>
	    </div>

        <div id="comments-link-32433845" data-rep=50 data-anon=true>
                    <a class="js-add-link comments-link disabled-link" title="Use comments to ask for more information or suggest improvements. Say thanks by reacting to the answer."  href="#" role="button">add a comment</a>
                <span class="js-link-separator dno">&nbsp;|&nbsp;</span>
            <a class="js-show-link comments-link dno" title="expand to show all comments on this post" href=# onclick="" role="button"></a>
        </div>         
    </div>
    </div>
</div>

                                          
<a name="50942351"></a>
<div id="answer-50942351" class="answer" data-answerid="50942351"  itemprop="suggestedAnswer" itemscope itemtype="http://schema.org/Answer">
    <div class="post-layout">
        <div class="votecell post-layout--left">
            <div class="js-voting-container grid fd-column ai-stretch gs4 fc-black-200" data-post-id="50942351">
        <button class="js-vote-up-btn grid--cell s-btn s-btn__unset c-pointer" data-controller="s-tooltip" data-s-tooltip-placement="right" title="Upvote this answer if you find it clear and useful." aria-pressed="false" aria-label="Up vote" data-selected-classes="fc-theme-primary"><svg aria-hidden="true" class="m0 svg-icon iconArrowUpLg" width="36" height="36" viewBox="0 0 36 36"><path d="M2 26h32L18 10 2 26z"/></svg></button>
        <div class="js-vote-count grid--cell fc-black-500 fs-title grid fd-column ai-center" itemprop="upvoteCount" data-value="20">20</div>
        <button class="js-vote-down-btn grid--cell s-btn s-btn__unset c-pointer" data-controller="s-tooltip" data-s-tooltip-placement="right" title="Downvote this answer if you find it unclear or not useful." aria-pressed="false" aria-label="Down vote" data-selected-classes="fc-theme-primary"><svg aria-hidden="true" class="m0 svg-icon iconArrowDownLg" width="36" height="36" viewBox="0 0 36 36"><path d="M2 10h32L18 26 2 10z"/></svg></button>

    
            <div class="js-accepted-answer-indicator grid--cell fc-green-500 ta-center py4 d-none" data-s-tooltip-placement="right" title="Loading when this answer was accepted&#x2026;" tabindex="0" role="note" aria-label="Accepted">
                <svg aria-hidden="true" class="svg-icon iconCheckmarkLg" width="36" height="36" viewBox="0 0 36 36"><path d="M6 14l8 8L30 6v8L14 30l-8-8v-8z"/></svg>
            </div>

        
<div class="js-reactions grid--cell"
     data-controller="reactions"
     data-count="0"
     data-action="post:reactionsInit->reactions#updateUI">
        <button class="s-btn s-btn__unset w100 py4 c-pointer" aria-label="Thanks (0)" data-target="reactions.button" data-action="reactions#tryToggle keypress->reactions#tryToggle" aria-pressed="false"
                data-controller="s-tooltip" data-s-tooltip-placement="right" data-s-tooltip-html-title="Say &lt;b&gt;thanks&lt;/b&gt; for this answer."><svg aria-hidden="true" class="svg-icon iconHandsTogether" width="18" height="18" viewBox="0 0 18 18"><path d="M3.85 1.15a.5.5 0 10-.7.7l2 2a.5.5 0 10.7-.7l-2-2zM5.5 6h-2a.5.5 0 000 1h2a.5.5 0 000-1zm10 1h-2a.5.5 0 010-1h2a.5.5 0 010 1zm.35-5.15a.5.5 0 00-.7-.7l-2 2a.5.5 0 00.7.7l2-2z" opacity=".4"/><path d="M8.21 16.49c-.44.37-1.02.55-1.6.51H5v-6h2l1-7.63c0-.2.23-.37.5-.37s.5.17.5.37V15a2.23 2.23 0 01-.79 1.49zm2.58 0c.44.37 1.02.55 1.6.51H14v-6h-2l-1-7.63c0-.2-.23-.37-.5-.37s-.5.17-.5.37V15c.06.58.34 1.11.79 1.49z" fill="#FFC166"/><path d="M2.5 11c-.83 0-1.5.67-1.5 1.5v3c0 .83.67 1.5 1.5 1.5H4v-6H2.5zm14 0H15v6h1.5c.83 0 1.5-.67 1.5-1.5v-3c0-.83-.67-1.5-1.5-1.5z" opacity=".7" fill="#07C"/></svg></button>
        <div class="ta-center fc-black-200 d-none" data-target="reactions.count"
             data-controller="s-tooltip" data-s-tooltip-placement="right" data-s-tooltip-html-title="0 others reacted with &lt;b&gt;thanks&lt;/b&gt;.">0</div>
</div>

    
        <a class="js-post-issue grid--cell s-btn s-btn__unset c-pointer py6 mx-auto" href="/posts/50942351/timeline" data-shortcut="T" data-controller="s-tooltip" data-s-tooltip-placement="right" title="Show activity on this post." aria-label="Timeline"><svg aria-hidden="true" class="mln2 mr0 svg-icon iconHistory" width="19" height="18" viewBox="0 0 19 18"><path d="M3 9a8 8 0 113.73 6.77L8.2 14.3A6 6 0 105 9l3.01-.01-4 4-4-4h3L3 9zm7-4h1.01L11 9.36l3.22 2.1-.6.93L10 10V5z"/></svg></a>

</div>

        </div>

        

<div class="answercell post-layout--right">
    
    <div class="post-text" itemprop="text">
<pre><code>$(date +%F_%H-%M-%S)
</code></pre>

<p>can be used to remove colons (:) in between</p>

<p>output</p>

<pre><code>2018-06-20_09-55-58
</code></pre>
    </div>
    <div class="grid mb0 fw-wrap ai-start jc-end gs8 gsy">
        <time itemprop="dateCreated" datetime="2018-06-20T07:14:21"></time>
        <div class="grid--cell mr16" style="flex: 1 1 100px;">
            

<div class="post-menu">
    <a href="/a/50942351"
       rel="nofollow"
       itemprop="url"
       class="js-share-link js-gps-track"
       title="short permalink to this answer"
       data-gps-track="post.click({ item: 2, priv: 0, post_type: 2 })"
       data-controller="se-share-sheet"
       data-se-share-sheet-title="Share a link to this answer"
       data-se-share-sheet-subtitle=""
       data-se-share-sheet-post-type="answer"
       data-se-share-sheet-social="facebook twitter devto"
       data-se-share-sheet-location="2"
       data-se-share-sheet-license-url="https%3a%2f%2fcreativecommons.org%2flicenses%2fby-sa%2f4.0%2f"
       data-se-share-sheet-license-name="CC BY-SA 4.0"
       data-s-popover-placement="bottom-start">share</a>
        <span class="lsep">|</span>
                <a href="/posts/50942351/edit" class="suggest-edit-post js-gps-track" data-gps-track="post.click({ item: 6, priv: 0, post_type: 2 })" title="">improve this answer</a>
        <span class="lsep">|</span>
    <button id="btnFollowPost-50942351" class="s-btn s-btn__link fc-black-400 h:fc-black-700 pb2 js-follow-post js-follow-answer js-gps-track" role="button"
            data-gps-track="post.click({ item: 14, priv: 0, post_type: 2 })"
            data-controller="s-tooltip " data-s-tooltip-placement="bottom"
            data-s-popover-placement="bottom" aria-controls=""
            title="Follow this answer to receive notifications">
        follow
    </button>
        <span class="lsep">|</span>
</div>

        </div>


    <div class="post-signature grid--cell fl0">
        <div class="user-info user-hover">
    <div class="user-action-time">
        answered <span title="2018-06-20 07:14:21Z" class="relativetime">Jun 20 '18 at 7:14</span>
    </div>
    <div class="user-gravatar32">
        <a href="/users/5814405/ahmettolga"><div class="gravatar-wrapper-32"><img src="https://i.stack.imgur.com/5MAzh.jpg?s=32&amp;g=1" alt="" width="32" height="32" class="bar-sm"></div></a>
    </div>
    <div class="user-details" itemprop="author" itemscope itemtype="http://schema.org/Person">
        <a href="/users/5814405/ahmettolga">ahmettolga</a><span class="d-none" itemprop="name">ahmettolga</span>
        <div class="-flair">
            <span class="reputation-score" title="reputation score " dir="ltr">369</span><span title="2 silver badges" aria-hidden="true"><span class="badge2"></span><span class="badgecount">2</span></span><span class="v-visible-sr">2 silver badges</span><span title="14 bronze badges" aria-hidden="true"><span class="badge3"></span><span class="badgecount">14</span></span><span class="v-visible-sr">14 bronze badges</span>
        </div>
    </div>
</div>

    </div>
    </div>
    
</div>


                <div class="post-layout--right">
        <div id="comments-50942351" class="comments js-comments-container bt bc-black-2 mt12  dno" data-post-id="50942351" data-min-length="15">
            <ul class="comments-list js-comments-list"
                    data-remaining-comments-count="0"
                    data-canpost="false"
                    data-cansee="true"
                    data-comments-unavailable="false"
                    data-addlink-disabled="true">

            </ul>
	    </div>

        <div id="comments-link-50942351" data-rep=50 data-anon=true>
                    <a class="js-add-link comments-link disabled-link" title="Use comments to ask for more information or suggest improvements. Say thanks by reacting to the answer."  href="#" role="button">add a comment</a>
                <span class="js-link-separator dno">&nbsp;|&nbsp;</span>
            <a class="js-show-link comments-link dno" title="expand to show all comments on this post" href=# onclick="" role="button"></a>
        </div>         
    </div>
    </div>
</div>

                                          
<a name="47216077"></a>
<div id="answer-47216077" class="answer" data-answerid="47216077"  itemprop="suggestedAnswer" itemscope itemtype="http://schema.org/Answer">
    <div class="post-layout">
        <div class="votecell post-layout--left">
            <div class="js-voting-container grid fd-column ai-stretch gs4 fc-black-200" data-post-id="47216077">
        <button class="js-vote-up-btn grid--cell s-btn s-btn__unset c-pointer" data-controller="s-tooltip" data-s-tooltip-placement="right" title="Upvote this answer if you find it clear and useful." aria-pressed="false" aria-label="Up vote" data-selected-classes="fc-theme-primary"><svg aria-hidden="true" class="m0 svg-icon iconArrowUpLg" width="36" height="36" viewBox="0 0 36 36"><path d="M2 26h32L18 10 2 26z"/></svg></button>
        <div class="js-vote-count grid--cell fc-black-500 fs-title grid fd-column ai-center" itemprop="upvoteCount" data-value="19">19</div>
        <button class="js-vote-down-btn grid--cell s-btn s-btn__unset c-pointer" data-controller="s-tooltip" data-s-tooltip-placement="right" title="Downvote this answer if you find it unclear or not useful." aria-pressed="false" aria-label="Down vote" data-selected-classes="fc-theme-primary"><svg aria-hidden="true" class="m0 svg-icon iconArrowDownLg" width="36" height="36" viewBox="0 0 36 36"><path d="M2 10h32L18 26 2 10z"/></svg></button>

    
            <div class="js-accepted-answer-indicator grid--cell fc-green-500 ta-center py4 d-none" data-s-tooltip-placement="right" title="Loading when this answer was accepted&#x2026;" tabindex="0" role="note" aria-label="Accepted">
                <svg aria-hidden="true" class="svg-icon iconCheckmarkLg" width="36" height="36" viewBox="0 0 36 36"><path d="M6 14l8 8L30 6v8L14 30l-8-8v-8z"/></svg>
            </div>

        
<div class="js-reactions grid--cell"
     data-controller="reactions"
     data-count="0"
     data-action="post:reactionsInit->reactions#updateUI">
        <button class="s-btn s-btn__unset w100 py4 c-pointer" aria-label="Thanks (0)" data-target="reactions.button" data-action="reactions#tryToggle keypress->reactions#tryToggle" aria-pressed="false"
                data-controller="s-tooltip" data-s-tooltip-placement="right" data-s-tooltip-html-title="Say &lt;b&gt;thanks&lt;/b&gt; for this answer."><svg aria-hidden="true" class="svg-icon iconHandsTogether" width="18" height="18" viewBox="0 0 18 18"><path d="M3.85 1.15a.5.5 0 10-.7.7l2 2a.5.5 0 10.7-.7l-2-2zM5.5 6h-2a.5.5 0 000 1h2a.5.5 0 000-1zm10 1h-2a.5.5 0 010-1h2a.5.5 0 010 1zm.35-5.15a.5.5 0 00-.7-.7l-2 2a.5.5 0 00.7.7l2-2z" opacity=".4"/><path d="M8.21 16.49c-.44.37-1.02.55-1.6.51H5v-6h2l1-7.63c0-.2.23-.37.5-.37s.5.17.5.37V15a2.23 2.23 0 01-.79 1.49zm2.58 0c.44.37 1.02.55 1.6.51H14v-6h-2l-1-7.63c0-.2-.23-.37-.5-.37s-.5.17-.5.37V15c.06.58.34 1.11.79 1.49z" fill="#FFC166"/><path d="M2.5 11c-.83 0-1.5.67-1.5 1.5v3c0 .83.67 1.5 1.5 1.5H4v-6H2.5zm14 0H15v6h1.5c.83 0 1.5-.67 1.5-1.5v-3c0-.83-.67-1.5-1.5-1.5z" opacity=".7" fill="#07C"/></svg></button>
        <div class="ta-center fc-black-200 d-none" data-target="reactions.count"
             data-controller="s-tooltip" data-s-tooltip-placement="right" data-s-tooltip-html-title="0 others reacted with &lt;b&gt;thanks&lt;/b&gt;.">0</div>
</div>

    
        <a class="js-post-issue grid--cell s-btn s-btn__unset c-pointer py6 mx-auto" href="/posts/47216077/timeline" data-shortcut="T" data-controller="s-tooltip" data-s-tooltip-placement="right" title="Show activity on this post." aria-label="Timeline"><svg aria-hidden="true" class="mln2 mr0 svg-icon iconHistory" width="19" height="18" viewBox="0 0 19 18"><path d="M3 9a8 8 0 113.73 6.77L8.2 14.3A6 6 0 105 9l3.01-.01-4 4-4-4h3L3 9zm7-4h1.01L11 9.36l3.22 2.1-.6.93L10 10V5z"/></svg></a>

</div>

        </div>

        

<div class="answercell post-layout--right">
    
    <div class="post-text" itemprop="text">
<p>With recent Bash (version ≥ 4.2), you can use the builtin <code>printf</code> with the format modifier <code>%(strftime_format)T</code>:</p>

<pre><code>$ printf '%(%Y-%m-%d)T\n' -1  # Get YYYY-MM-DD (-1 stands for "current time")
2017-11-10
$ printf '%(%F)T\n' -1  # Synonym of the above
2017-11-10
$ printf -v date '%(%F)T' -1  # Capture as var $date
</code></pre>

<p><code>printf</code> is much faster than <code>date</code> since it's a Bash builtin while <code>date</code> is an external command.</p>

<p>As well, <code>printf -v date ...</code> is faster than <code>date=$(printf ...)</code> since it doesn't require forking a subshell.</p>
    </div>
    <div class="grid mb0 fw-wrap ai-start jc-end gs8 gsy">
        <time itemprop="dateCreated" datetime="2017-11-10T05:15:22"></time>
        <div class="grid--cell mr16" style="flex: 1 1 100px;">
            

<div class="post-menu">
    <a href="/a/47216077"
       rel="nofollow"
       itemprop="url"
       class="js-share-link js-gps-track"
       title="short permalink to this answer"
       data-gps-track="post.click({ item: 2, priv: 0, post_type: 2 })"
       data-controller="se-share-sheet"
       data-se-share-sheet-title="Share a link to this answer"
       data-se-share-sheet-subtitle=""
       data-se-share-sheet-post-type="answer"
       data-se-share-sheet-social="facebook twitter devto"
       data-se-share-sheet-location="2"
       data-se-share-sheet-license-url="https%3a%2f%2fcreativecommons.org%2flicenses%2fby-sa%2f4.0%2f"
       data-se-share-sheet-license-name="CC BY-SA 4.0"
       data-s-popover-placement="bottom-start">share</a>
        <span class="lsep">|</span>
                <a href="/posts/47216077/edit" class="suggest-edit-post js-gps-track" data-gps-track="post.click({ item: 6, priv: 0, post_type: 2 })" title="">improve this answer</a>
        <span class="lsep">|</span>
    <button id="btnFollowPost-47216077" class="s-btn s-btn__link fc-black-400 h:fc-black-700 pb2 js-follow-post js-follow-answer js-gps-track" role="button"
            data-gps-track="post.click({ item: 14, priv: 0, post_type: 2 })"
            data-controller="s-tooltip " data-s-tooltip-placement="bottom"
            data-s-popover-placement="bottom" aria-controls=""
            title="Follow this answer to receive notifications">
        follow
    </button>
        <span class="lsep">|</span>
</div>

        </div>
    <div class="post-signature grid--cell fl0">
<div class="user-info ">
    <div class="user-action-time">
        <a href="/posts/47216077/revisions" title="show all edits to this post"
                         class="js-gps-track"
                         data-gps-track="post.click({ item: 4, priv: 0, post_type: 2 })">edited <span title="2019-05-24 14:29:54Z" class="relativetime">May 24 '19 at 14:29</span></a>
    </div>
    <div class="user-gravatar32">
        
    </div>
    <div class="user-details">
        
        <div class="-flair">
            
        </div>
    </div>
</div>    </div>


    <div class="post-signature grid--cell fl0">
        <div class="user-info user-hover">
    <div class="user-action-time">
        answered <span title="2017-11-10 05:15:22Z" class="relativetime">Nov 10 '17 at 5:15</span>
    </div>
    <div class="user-gravatar32">
        <a href="/users/4518341/wjandrea"><div class="gravatar-wrapper-32"><img src="https://i.stack.imgur.com/eVuAv.png?s=32&amp;g=1" alt="" width="32" height="32" class="bar-sm"></div></a>
    </div>
    <div class="user-details" itemprop="author" itemscope itemtype="http://schema.org/Person">
        <a href="/users/4518341/wjandrea">wjandrea</a><span class="d-none" itemprop="name">wjandrea</span>
        <div class="-flair">
            <span class="reputation-score" title="reputation score " dir="ltr">9,989</span><span title="5 gold badges" aria-hidden="true"><span class="badge1"></span><span class="badgecount">5</span></span><span class="v-visible-sr">5 gold badges</span><span title="20 silver badges" aria-hidden="true"><span class="badge2"></span><span class="badgecount">20</span></span><span class="v-visible-sr">20 silver badges</span><span title="46 bronze badges" aria-hidden="true"><span class="badge3"></span><span class="badgecount">46</span></span><span class="v-visible-sr">46 bronze badges</span>
        </div>
    </div>
</div>

    </div>
    </div>
    
</div>


                <div class="post-layout--right">
        <div id="comments-47216077" class="comments js-comments-container bt bc-black-2 mt12 " data-post-id="47216077" data-min-length="15">
            <ul class="comments-list js-comments-list"
                    data-remaining-comments-count="0"
                    data-canpost="false"
                    data-cansee="true"
                    data-comments-unavailable="false"
                    data-addlink-disabled="true">

                        <li id="comment-99199114" class="comment js-comment " data-comment-id="99199114">
        <div class="js-comment-actions comment-actions">
            <div class="comment-score js-comment-edit-hide">
                    <span title="number of &#x27;useful comment&#x27; votes received"
                            class="cool">4</span>
            </div>
        </div>
        <div class="comment-text js-comment-text-and-form">
            <div class="comment-body js-comment-edit-hide">
                
                <span class="comment-copy">As a note in 2019, this command is incredibly faster* than <code>date</code> if you are using this from within a bash script already, as it doesn&#39;t have to load any extra libraries. (* I measured on my linux server a ~160x speed difference over 1000 iterations)</span>
                
&ndash;&nbsp;<a href="/users/1924337/timtj"
                       title="94 reputation"
                       class="comment-user">timtj</a>
                <span class="comment-date" dir="ltr"><span title="2019-05-24 13:11:17Z, License: CC BY-SA 4.0" class="relativetime-clean">May 24 '19 at 13:11</span></span>
            </div>
        </div>
    </li>
    <li id="comment-99202060" class="comment js-comment " data-comment-id="99202060">
        <div class="js-comment-actions comment-actions">
            <div class="comment-score js-comment-edit-hide">
            </div>
        </div>
        <div class="comment-text js-comment-text-and-form">
            <div class="comment-body js-comment-edit-hide">
                
                <span class="comment-copy">@timtj Thanks for pointing that out! I added some notes about speed to the answer.</span>
                
&ndash;&nbsp;<a href="/users/4518341/wjandrea"
                       title="9,989 reputation"
                       class="comment-user">wjandrea</a>
                <span class="comment-date" dir="ltr"><span title="2019-05-24 14:35:58Z, License: CC BY-SA 4.0" class="relativetime-clean">May 24 '19 at 14:35</span></span>
            </div>
        </div>
    </li>
    <li id="comment-99236562" class="comment js-comment " data-comment-id="99236562">
        <div class="js-comment-actions comment-actions">
            <div class="comment-score js-comment-edit-hide">
                    <span title="number of &#x27;useful comment&#x27; votes received"
                            class="cool">1</span>
            </div>
        </div>
        <div class="comment-text js-comment-text-and-form">
            <div class="comment-body js-comment-edit-hide">
                
                <span class="comment-copy">I wish I could +5 for the comment about <code>printf -v date</code> not forking a subshell. Very good info!!</span>
                
&ndash;&nbsp;<a href="/users/1924337/timtj"
                       title="94 reputation"
                       class="comment-user">timtj</a>
                <span class="comment-date" dir="ltr"><span title="2019-05-26 12:47:42Z, License: CC BY-SA 4.0" class="relativetime-clean">May 26 '19 at 12:47</span></span>
            </div>
        </div>
    </li>
    <li id="comment-102732353" class="comment js-comment " data-comment-id="102732353">
        <div class="js-comment-actions comment-actions">
            <div class="comment-score js-comment-edit-hide">
            </div>
        </div>
        <div class="comment-text js-comment-text-and-form">
            <div class="comment-body js-comment-edit-hide">
                
                <span class="comment-copy">Usually I use date because I also need to increment through some dates. Can printf do date arithmetic?</span>
                
&ndash;&nbsp;<a href="/users/2223505/merlin"
                       title="755 reputation"
                       class="comment-user">Merlin</a>
                <span class="comment-date" dir="ltr"><span title="2019-09-30 22:07:16Z, License: CC BY-SA 4.0" class="relativetime-clean">Sep 30 '19 at 22:07</span></span>
            </div>
        </div>
    </li>
    <li id="comment-102732962" class="comment js-comment " data-comment-id="102732962">
        <div class="js-comment-actions comment-actions">
            <div class="comment-score js-comment-edit-hide">
                    <span title="number of &#x27;useful comment&#x27; votes received"
                            class="cool">1</span>
            </div>
        </div>
        <div class="comment-text js-comment-text-and-form">
            <div class="comment-body js-comment-edit-hide">
                
                <span class="comment-copy">@Merlin I don&#39;t think so</span>
                
&ndash;&nbsp;<a href="/users/4518341/wjandrea"
                       title="9,989 reputation"
                       class="comment-user">wjandrea</a>
                <span class="comment-date" dir="ltr"><span title="2019-09-30 22:52:31Z, License: CC BY-SA 4.0" class="relativetime-clean">Sep 30 '19 at 22:52</span></span>
            </div>
        </div>
    </li>

            </ul>
	    </div>

        <div id="comments-link-47216077" data-rep=50 data-anon=true>
                    <a class="js-add-link comments-link disabled-link" title="Use comments to ask for more information or suggest improvements. Say thanks by reacting to the answer."  href="#" role="button">add a comment</a>
                <span class="js-link-separator dno">&nbsp;|&nbsp;</span>
            <a class="js-show-link comments-link dno" title="expand to show all comments on this post" href=# onclick="" role="button"></a>
        </div>         
    </div>
    </div>
</div>

                                          
<a name="50242486"></a>
<div id="answer-50242486" class="answer" data-answerid="50242486"  itemprop="suggestedAnswer" itemscope itemtype="http://schema.org/Answer">
    <div class="post-layout">
        <div class="votecell post-layout--left">
            <div class="js-voting-container grid fd-column ai-stretch gs4 fc-black-200" data-post-id="50242486">
        <button class="js-vote-up-btn grid--cell s-btn s-btn__unset c-pointer" data-controller="s-tooltip" data-s-tooltip-placement="right" title="Upvote this answer if you find it clear and useful." aria-pressed="false" aria-label="Up vote" data-selected-classes="fc-theme-primary"><svg aria-hidden="true" class="m0 svg-icon iconArrowUpLg" width="36" height="36" viewBox="0 0 36 36"><path d="M2 26h32L18 10 2 26z"/></svg></button>
        <div class="js-vote-count grid--cell fc-black-500 fs-title grid fd-column ai-center" itemprop="upvoteCount" data-value="8">8</div>
        <button class="js-vote-down-btn grid--cell s-btn s-btn__unset c-pointer" data-controller="s-tooltip" data-s-tooltip-placement="right" title="Downvote this answer if you find it unclear or not useful." aria-pressed="false" aria-label="Down vote" data-selected-classes="fc-theme-primary"><svg aria-hidden="true" class="m0 svg-icon iconArrowDownLg" width="36" height="36" viewBox="0 0 36 36"><path d="M2 10h32L18 26 2 10z"/></svg></button>

    
            <div class="js-accepted-answer-indicator grid--cell fc-green-500 ta-center py4 d-none" data-s-tooltip-placement="right" title="Loading when this answer was accepted&#x2026;" tabindex="0" role="note" aria-label="Accepted">
                <svg aria-hidden="true" class="svg-icon iconCheckmarkLg" width="36" height="36" viewBox="0 0 36 36"><path d="M6 14l8 8L30 6v8L14 30l-8-8v-8z"/></svg>
            </div>

        
<div class="js-reactions grid--cell"
     data-controller="reactions"
     data-count="0"
     data-action="post:reactionsInit->reactions#updateUI">
        <button class="s-btn s-btn__unset w100 py4 c-pointer" aria-label="Thanks (0)" data-target="reactions.button" data-action="reactions#tryToggle keypress->reactions#tryToggle" aria-pressed="false"
                data-controller="s-tooltip" data-s-tooltip-placement="right" data-s-tooltip-html-title="Say &lt;b&gt;thanks&lt;/b&gt; for this answer."><svg aria-hidden="true" class="svg-icon iconHandsTogether" width="18" height="18" viewBox="0 0 18 18"><path d="M3.85 1.15a.5.5 0 10-.7.7l2 2a.5.5 0 10.7-.7l-2-2zM5.5 6h-2a.5.5 0 000 1h2a.5.5 0 000-1zm10 1h-2a.5.5 0 010-1h2a.5.5 0 010 1zm.35-5.15a.5.5 0 00-.7-.7l-2 2a.5.5 0 00.7.7l2-2z" opacity=".4"/><path d="M8.21 16.49c-.44.37-1.02.55-1.6.51H5v-6h2l1-7.63c0-.2.23-.37.5-.37s.5.17.5.37V15a2.23 2.23 0 01-.79 1.49zm2.58 0c.44.37 1.02.55 1.6.51H14v-6h-2l-1-7.63c0-.2-.23-.37-.5-.37s-.5.17-.5.37V15c.06.58.34 1.11.79 1.49z" fill="#FFC166"/><path d="M2.5 11c-.83 0-1.5.67-1.5 1.5v3c0 .83.67 1.5 1.5 1.5H4v-6H2.5zm14 0H15v6h1.5c.83 0 1.5-.67 1.5-1.5v-3c0-.83-.67-1.5-1.5-1.5z" opacity=".7" fill="#07C"/></svg></button>
        <div class="ta-center fc-black-200 d-none" data-target="reactions.count"
             data-controller="s-tooltip" data-s-tooltip-placement="right" data-s-tooltip-html-title="0 others reacted with &lt;b&gt;thanks&lt;/b&gt;.">0</div>
</div>

    
        <a class="js-post-issue grid--cell s-btn s-btn__unset c-pointer py6 mx-auto" href="/posts/50242486/timeline" data-shortcut="T" data-controller="s-tooltip" data-s-tooltip-placement="right" title="Show activity on this post." aria-label="Timeline"><svg aria-hidden="true" class="mln2 mr0 svg-icon iconHistory" width="19" height="18" viewBox="0 0 19 18"><path d="M3 9a8 8 0 113.73 6.77L8.2 14.3A6 6 0 105 9l3.01-.01-4 4-4-4h3L3 9zm7-4h1.01L11 9.36l3.22 2.1-.6.93L10 10V5z"/></svg></a>

</div>

        </div>

        

<div class="answercell post-layout--right">
    
    <div class="post-text" itemprop="text">
<p>Whenever I have a task like this I end up falling back to </p>

<pre><code>$ man strftime
</code></pre>

<p>to remind myself of all the possibilities. </p>
    </div>
    <div class="grid mb0 fw-wrap ai-start jc-end gs8 gsy">
        <time itemprop="dateCreated" datetime="2018-05-08T21:25:57"></time>
        <div class="grid--cell mr16" style="flex: 1 1 100px;">
            

<div class="post-menu">
    <a href="/a/50242486"
       rel="nofollow"
       itemprop="url"
       class="js-share-link js-gps-track"
       title="short permalink to this answer"
       data-gps-track="post.click({ item: 2, priv: 0, post_type: 2 })"
       data-controller="se-share-sheet"
       data-se-share-sheet-title="Share a link to this answer"
       data-se-share-sheet-subtitle=""
       data-se-share-sheet-post-type="answer"
       data-se-share-sheet-social="facebook twitter devto"
       data-se-share-sheet-location="2"
       data-se-share-sheet-license-url="https%3a%2f%2fcreativecommons.org%2flicenses%2fby-sa%2f4.0%2f"
       data-se-share-sheet-license-name="CC BY-SA 4.0"
       data-s-popover-placement="bottom-start">share</a>
        <span class="lsep">|</span>
                <a href="/posts/50242486/edit" class="suggest-edit-post js-gps-track" data-gps-track="post.click({ item: 6, priv: 0, post_type: 2 })" title="">improve this answer</a>
        <span class="lsep">|</span>
    <button id="btnFollowPost-50242486" class="s-btn s-btn__link fc-black-400 h:fc-black-700 pb2 js-follow-post js-follow-answer js-gps-track" role="button"
            data-gps-track="post.click({ item: 14, priv: 0, post_type: 2 })"
            data-controller="s-tooltip " data-s-tooltip-placement="bottom"
            data-s-popover-placement="bottom" aria-controls=""
            title="Follow this answer to receive notifications">
        follow
    </button>
        <span class="lsep">|</span>
</div>

        </div>


    <div class="post-signature grid--cell fl0">
        <div class="user-info user-hover">
    <div class="user-action-time">
        answered <span title="2018-05-08 21:25:57Z" class="relativetime">May 8 '18 at 21:25</span>
    </div>
    <div class="user-gravatar32">
        <a href="/users/2654767/arp"><div class="gravatar-wrapper-32"><img src="https://www.gravatar.com/avatar/7434b5b966c34a27e2e1a720d128173f?s=32&amp;d=identicon&amp;r=PG" alt="" width="32" height="32" class="bar-sm"></div></a>
    </div>
    <div class="user-details" itemprop="author" itemscope itemtype="http://schema.org/Person">
        <a href="/users/2654767/arp">arp</a><span class="d-none" itemprop="name">arp</span>
        <div class="-flair">
            <span class="reputation-score" title="reputation score " dir="ltr">281</span><span title="3 silver badges" aria-hidden="true"><span class="badge2"></span><span class="badgecount">3</span></span><span class="v-visible-sr">3 silver badges</span><span title="7 bronze badges" aria-hidden="true"><span class="badge3"></span><span class="badgecount">7</span></span><span class="v-visible-sr">7 bronze badges</span>
        </div>
    </div>
</div>

    </div>
    </div>
    
</div>


                <div class="post-layout--right">
        <div id="comments-50242486" class="comments js-comments-container bt bc-black-2 mt12  dno" data-post-id="50242486" data-min-length="15">
            <ul class="comments-list js-comments-list"
                    data-remaining-comments-count="0"
                    data-canpost="false"
                    data-cansee="true"
                    data-comments-unavailable="false"
                    data-addlink-disabled="true">

            </ul>
	    </div>

        <div id="comments-link-50242486" data-rep=50 data-anon=true>
                    <a class="js-add-link comments-link disabled-link" title="Use comments to ask for more information or suggest improvements. Say thanks by reacting to the answer."  href="#" role="button">add a comment</a>
                <span class="js-link-separator dno">&nbsp;|&nbsp;</span>
            <a class="js-show-link comments-link dno" title="expand to show all comments on this post" href=# onclick="" role="button"></a>
        </div>         
    </div>
    </div>
</div>

                                          
<a name="44335698"></a>
<div id="answer-44335698" class="answer" data-answerid="44335698"  itemprop="suggestedAnswer" itemscope itemtype="http://schema.org/Answer">
    <div class="post-layout">
        <div class="votecell post-layout--left">
            <div class="js-voting-container grid fd-column ai-stretch gs4 fc-black-200" data-post-id="44335698">
        <button class="js-vote-up-btn grid--cell s-btn s-btn__unset c-pointer" data-controller="s-tooltip" data-s-tooltip-placement="right" title="Upvote this answer if you find it clear and useful." aria-pressed="false" aria-label="Up vote" data-selected-classes="fc-theme-primary"><svg aria-hidden="true" class="m0 svg-icon iconArrowUpLg" width="36" height="36" viewBox="0 0 36 36"><path d="M2 26h32L18 10 2 26z"/></svg></button>
        <div class="js-vote-count grid--cell fc-black-500 fs-title grid fd-column ai-center" itemprop="upvoteCount" data-value="7">7</div>
        <button class="js-vote-down-btn grid--cell s-btn s-btn__unset c-pointer" data-controller="s-tooltip" data-s-tooltip-placement="right" title="Downvote this answer if you find it unclear or not useful." aria-pressed="false" aria-label="Down vote" data-selected-classes="fc-theme-primary"><svg aria-hidden="true" class="m0 svg-icon iconArrowDownLg" width="36" height="36" viewBox="0 0 36 36"><path d="M2 10h32L18 26 2 10z"/></svg></button>

    
            <div class="js-accepted-answer-indicator grid--cell fc-green-500 ta-center py4 d-none" data-s-tooltip-placement="right" title="Loading when this answer was accepted&#x2026;" tabindex="0" role="note" aria-label="Accepted">
                <svg aria-hidden="true" class="svg-icon iconCheckmarkLg" width="36" height="36" viewBox="0 0 36 36"><path d="M6 14l8 8L30 6v8L14 30l-8-8v-8z"/></svg>
            </div>

        
<div class="js-reactions grid--cell"
     data-controller="reactions"
     data-count="0"
     data-action="post:reactionsInit->reactions#updateUI">
        <button class="s-btn s-btn__unset w100 py4 c-pointer" aria-label="Thanks (0)" data-target="reactions.button" data-action="reactions#tryToggle keypress->reactions#tryToggle" aria-pressed="false"
                data-controller="s-tooltip" data-s-tooltip-placement="right" data-s-tooltip-html-title="Say &lt;b&gt;thanks&lt;/b&gt; for this answer."><svg aria-hidden="true" class="svg-icon iconHandsTogether" width="18" height="18" viewBox="0 0 18 18"><path d="M3.85 1.15a.5.5 0 10-.7.7l2 2a.5.5 0 10.7-.7l-2-2zM5.5 6h-2a.5.5 0 000 1h2a.5.5 0 000-1zm10 1h-2a.5.5 0 010-1h2a.5.5 0 010 1zm.35-5.15a.5.5 0 00-.7-.7l-2 2a.5.5 0 00.7.7l2-2z" opacity=".4"/><path d="M8.21 16.49c-.44.37-1.02.55-1.6.51H5v-6h2l1-7.63c0-.2.23-.37.5-.37s.5.17.5.37V15a2.23 2.23 0 01-.79 1.49zm2.58 0c.44.37 1.02.55 1.6.51H14v-6h-2l-1-7.63c0-.2-.23-.37-.5-.37s-.5.17-.5.37V15c.06.58.34 1.11.79 1.49z" fill="#FFC166"/><path d="M2.5 11c-.83 0-1.5.67-1.5 1.5v3c0 .83.67 1.5 1.5 1.5H4v-6H2.5zm14 0H15v6h1.5c.83 0 1.5-.67 1.5-1.5v-3c0-.83-.67-1.5-1.5-1.5z" opacity=".7" fill="#07C"/></svg></button>
        <div class="ta-center fc-black-200 d-none" data-target="reactions.count"
             data-controller="s-tooltip" data-s-tooltip-placement="right" data-s-tooltip-html-title="0 others reacted with &lt;b&gt;thanks&lt;/b&gt;.">0</div>
</div>

    
        <a class="js-post-issue grid--cell s-btn s-btn__unset c-pointer py6 mx-auto" href="/posts/44335698/timeline" data-shortcut="T" data-controller="s-tooltip" data-s-tooltip-placement="right" title="Show activity on this post." aria-label="Timeline"><svg aria-hidden="true" class="mln2 mr0 svg-icon iconHistory" width="19" height="18" viewBox="0 0 19 18"><path d="M3 9a8 8 0 113.73 6.77L8.2 14.3A6 6 0 105 9l3.01-.01-4 4-4-4h3L3 9zm7-4h1.01L11 9.36l3.22 2.1-.6.93L10 10V5z"/></svg></a>

</div>

        </div>

        

<div class="answercell post-layout--right">
    
    <div class="post-text" itemprop="text">
<p>if you want the year in a two number format such as 17 rather than 2017, do the following:</p>

<pre><code>DATE=`date +%d-%m-%y`
</code></pre>
    </div>
    <div class="grid mb0 fw-wrap ai-start jc-end gs8 gsy">
        <time itemprop="dateCreated" datetime="2017-06-02T18:55:05"></time>
        <div class="grid--cell mr16" style="flex: 1 1 100px;">
            

<div class="post-menu">
    <a href="/a/44335698"
       rel="nofollow"
       itemprop="url"
       class="js-share-link js-gps-track"
       title="short permalink to this answer"
       data-gps-track="post.click({ item: 2, priv: 0, post_type: 2 })"
       data-controller="se-share-sheet"
       data-se-share-sheet-title="Share a link to this answer"
       data-se-share-sheet-subtitle=""
       data-se-share-sheet-post-type="answer"
       data-se-share-sheet-social="facebook twitter devto"
       data-se-share-sheet-location="2"
       data-se-share-sheet-license-url="https%3a%2f%2fcreativecommons.org%2flicenses%2fby-sa%2f3.0%2f"
       data-se-share-sheet-license-name="CC BY-SA 3.0"
       data-s-popover-placement="bottom-start">share</a>
        <span class="lsep">|</span>
                <a href="/posts/44335698/edit" class="suggest-edit-post js-gps-track" data-gps-track="post.click({ item: 6, priv: 0, post_type: 2 })" title="">improve this answer</a>
        <span class="lsep">|</span>
    <button id="btnFollowPost-44335698" class="s-btn s-btn__link fc-black-400 h:fc-black-700 pb2 js-follow-post js-follow-answer js-gps-track" role="button"
            data-gps-track="post.click({ item: 14, priv: 0, post_type: 2 })"
            data-controller="s-tooltip " data-s-tooltip-placement="bottom"
            data-s-popover-placement="bottom" aria-controls=""
            title="Follow this answer to receive notifications">
        follow
    </button>
        <span class="lsep">|</span>
</div>

        </div>
    <div class="post-signature grid--cell fl0">
<div class="user-info user-hover">
    <div class="user-action-time">
        <a href="/posts/44335698/revisions" title="show all edits to this post"
                         class="js-gps-track"
                         data-gps-track="post.click({ item: 4, priv: 0, post_type: 2 })">edited <span title="2017-08-16 21:01:52Z" class="relativetime">Aug 16 '17 at 21:01</span></a>
    </div>
    <div class="user-gravatar32">
        <a href="/users/2654083/ford-prefect"><div class="gravatar-wrapper-32"><img src="https://www.gravatar.com/avatar/705663a74e13fc3e4a5bb6b6589798e1?s=32&amp;d=identicon&amp;r=PG" alt="" width="32" height="32" class="bar-sm"></div></a>
    </div>
    <div class="user-details">
        <a href="/users/2654083/ford-prefect">ford prefect</a>
        <div class="-flair">
            <span class="reputation-score" title="reputation score " dir="ltr">5,458</span><span title="9 gold badges" aria-hidden="true"><span class="badge1"></span><span class="badgecount">9</span></span><span class="v-visible-sr">9 gold badges</span><span title="46 silver badges" aria-hidden="true"><span class="badge2"></span><span class="badgecount">46</span></span><span class="v-visible-sr">46 silver badges</span><span title="74 bronze badges" aria-hidden="true"><span class="badge3"></span><span class="badgecount">74</span></span><span class="v-visible-sr">74 bronze badges</span>
        </div>
    </div>
</div>    </div>


    <div class="post-signature grid--cell fl0">
        <div class="user-info user-hover">
    <div class="user-action-time">
        answered <span title="2017-06-02 18:55:05Z" class="relativetime">Jun 2 '17 at 18:55</span>
    </div>
    <div class="user-gravatar32">
        <a href="/users/1292323/crt"><div class="gravatar-wrapper-32"><img src="https://www.gravatar.com/avatar/f7a98a391bd8d332904d079700897ecc?s=32&amp;d=identicon&amp;r=PG" alt="" width="32" height="32" class="bar-sm"></div></a>
    </div>
    <div class="user-details" itemprop="author" itemscope itemtype="http://schema.org/Person">
        <a href="/users/1292323/crt">Crt</a><span class="d-none" itemprop="name">Crt</span>
        <div class="-flair">
            <span class="reputation-score" title="reputation score " dir="ltr">3,262</span><span title="3 gold badges" aria-hidden="true"><span class="badge1"></span><span class="badgecount">3</span></span><span class="v-visible-sr">3 gold badges</span><span title="28 silver badges" aria-hidden="true"><span class="badge2"></span><span class="badgecount">28</span></span><span class="v-visible-sr">28 silver badges</span><span title="40 bronze badges" aria-hidden="true"><span class="badge3"></span><span class="badgecount">40</span></span><span class="v-visible-sr">40 bronze badges</span>
        </div>
    </div>
</div>

    </div>
    </div>
    
</div>


                <div class="post-layout--right">
        <div id="comments-44335698" class="comments js-comments-container bt bc-black-2 mt12  dno" data-post-id="44335698" data-min-length="15">
            <ul class="comments-list js-comments-list"
                    data-remaining-comments-count="0"
                    data-canpost="false"
                    data-cansee="true"
                    data-comments-unavailable="false"
                    data-addlink-disabled="true">

            </ul>
	    </div>

        <div id="comments-link-44335698" data-rep=50 data-anon=true>
                    <a class="js-add-link comments-link disabled-link" title="Use comments to ask for more information or suggest improvements. Say thanks by reacting to the answer."  href="#" role="button">add a comment</a>
                <span class="js-link-separator dno">&nbsp;|&nbsp;</span>
            <a class="js-show-link comments-link dno" title="expand to show all comments on this post" href=# onclick="" role="button"></a>
        </div>         
    </div>
    </div>
</div>

                                          
<a name="48320592"></a>
<div id="answer-48320592" class="answer" data-answerid="48320592"  itemprop="suggestedAnswer" itemscope itemtype="http://schema.org/Answer">
    <div class="post-layout">
        <div class="votecell post-layout--left">
            <div class="js-voting-container grid fd-column ai-stretch gs4 fc-black-200" data-post-id="48320592">
        <button class="js-vote-up-btn grid--cell s-btn s-btn__unset c-pointer" data-controller="s-tooltip" data-s-tooltip-placement="right" title="Upvote this answer if you find it clear and useful." aria-pressed="false" aria-label="Up vote" data-selected-classes="fc-theme-primary"><svg aria-hidden="true" class="m0 svg-icon iconArrowUpLg" width="36" height="36" viewBox="0 0 36 36"><path d="M2 26h32L18 10 2 26z"/></svg></button>
        <div class="js-vote-count grid--cell fc-black-500 fs-title grid fd-column ai-center" itemprop="upvoteCount" data-value="6">6</div>
        <button class="js-vote-down-btn grid--cell s-btn s-btn__unset c-pointer" data-controller="s-tooltip" data-s-tooltip-placement="right" title="Downvote this answer if you find it unclear or not useful." aria-pressed="false" aria-label="Down vote" data-selected-classes="fc-theme-primary"><svg aria-hidden="true" class="m0 svg-icon iconArrowDownLg" width="36" height="36" viewBox="0 0 36 36"><path d="M2 10h32L18 26 2 10z"/></svg></button>

    
            <div class="js-accepted-answer-indicator grid--cell fc-green-500 ta-center py4 d-none" data-s-tooltip-placement="right" title="Loading when this answer was accepted&#x2026;" tabindex="0" role="note" aria-label="Accepted">
                <svg aria-hidden="true" class="svg-icon iconCheckmarkLg" width="36" height="36" viewBox="0 0 36 36"><path d="M6 14l8 8L30 6v8L14 30l-8-8v-8z"/></svg>
            </div>

        
<div class="js-reactions grid--cell"
     data-controller="reactions"
     data-count="0"
     data-action="post:reactionsInit->reactions#updateUI">
        <button class="s-btn s-btn__unset w100 py4 c-pointer" aria-label="Thanks (0)" data-target="reactions.button" data-action="reactions#tryToggle keypress->reactions#tryToggle" aria-pressed="false"
                data-controller="s-tooltip" data-s-tooltip-placement="right" data-s-tooltip-html-title="Say &lt;b&gt;thanks&lt;/b&gt; for this answer."><svg aria-hidden="true" class="svg-icon iconHandsTogether" width="18" height="18" viewBox="0 0 18 18"><path d="M3.85 1.15a.5.5 0 10-.7.7l2 2a.5.5 0 10.7-.7l-2-2zM5.5 6h-2a.5.5 0 000 1h2a.5.5 0 000-1zm10 1h-2a.5.5 0 010-1h2a.5.5 0 010 1zm.35-5.15a.5.5 0 00-.7-.7l-2 2a.5.5 0 00.7.7l2-2z" opacity=".4"/><path d="M8.21 16.49c-.44.37-1.02.55-1.6.51H5v-6h2l1-7.63c0-.2.23-.37.5-.37s.5.17.5.37V15a2.23 2.23 0 01-.79 1.49zm2.58 0c.44.37 1.02.55 1.6.51H14v-6h-2l-1-7.63c0-.2-.23-.37-.5-.37s-.5.17-.5.37V15c.06.58.34 1.11.79 1.49z" fill="#FFC166"/><path d="M2.5 11c-.83 0-1.5.67-1.5 1.5v3c0 .83.67 1.5 1.5 1.5H4v-6H2.5zm14 0H15v6h1.5c.83 0 1.5-.67 1.5-1.5v-3c0-.83-.67-1.5-1.5-1.5z" opacity=".7" fill="#07C"/></svg></button>
        <div class="ta-center fc-black-200 d-none" data-target="reactions.count"
             data-controller="s-tooltip" data-s-tooltip-placement="right" data-s-tooltip-html-title="0 others reacted with &lt;b&gt;thanks&lt;/b&gt;.">0</div>
</div>

    
        <a class="js-post-issue grid--cell s-btn s-btn__unset c-pointer py6 mx-auto" href="/posts/48320592/timeline" data-shortcut="T" data-controller="s-tooltip" data-s-tooltip-placement="right" title="Show activity on this post." aria-label="Timeline"><svg aria-hidden="true" class="mln2 mr0 svg-icon iconHistory" width="19" height="18" viewBox="0 0 19 18"><path d="M3 9a8 8 0 113.73 6.77L8.2 14.3A6 6 0 105 9l3.01-.01-4 4-4-4h3L3 9zm7-4h1.01L11 9.36l3.22 2.1-.6.93L10 10V5z"/></svg></a>

</div>

        </div>

        

<div class="answercell post-layout--right">
    
    <div class="post-text" itemprop="text">
<pre><code>#!/bin/bash -e

x='2018-01-18 10:00:00'
a=$(date -d "$x")
b=$(date -d "$a 10 min" "+%Y-%m-%d %H:%M:%S")
c=$(date -d "$b 10 min" "+%Y-%m-%d %H:%M:%S")
#date -d "$a 30 min" "+%Y-%m-%d %H:%M:%S"

echo Entered Date is $x
echo Second Date is $b
echo Third Date is $c
</code></pre>

<p>Here x is sample date used &amp; then example displays both formatting of data as well as getting dates 10 mins more then current date.</p>
    </div>
    <div class="grid mb0 fw-wrap ai-start jc-end gs8 gsy">
        <time itemprop="dateCreated" datetime="2018-01-18T11:46:31"></time>
        <div class="grid--cell mr16" style="flex: 1 1 100px;">
            

<div class="post-menu">
    <a href="/a/48320592"
       rel="nofollow"
       itemprop="url"
       class="js-share-link js-gps-track"
       title="short permalink to this answer"
       data-gps-track="post.click({ item: 2, priv: 0, post_type: 2 })"
       data-controller="se-share-sheet"
       data-se-share-sheet-title="Share a link to this answer"
       data-se-share-sheet-subtitle=""
       data-se-share-sheet-post-type="answer"
       data-se-share-sheet-social="facebook twitter devto"
       data-se-share-sheet-location="2"
       data-se-share-sheet-license-url="https%3a%2f%2fcreativecommons.org%2flicenses%2fby-sa%2f3.0%2f"
       data-se-share-sheet-license-name="CC BY-SA 3.0"
       data-s-popover-placement="bottom-start">share</a>
        <span class="lsep">|</span>
                <a href="/posts/48320592/edit" class="suggest-edit-post js-gps-track" data-gps-track="post.click({ item: 6, priv: 0, post_type: 2 })" title="">improve this answer</a>
        <span class="lsep">|</span>
    <button id="btnFollowPost-48320592" class="s-btn s-btn__link fc-black-400 h:fc-black-700 pb2 js-follow-post js-follow-answer js-gps-track" role="button"
            data-gps-track="post.click({ item: 14, priv: 0, post_type: 2 })"
            data-controller="s-tooltip " data-s-tooltip-placement="bottom"
            data-s-popover-placement="bottom" aria-controls=""
            title="Follow this answer to receive notifications">
        follow
    </button>
        <span class="lsep">|</span>
</div>

        </div>


    <div class="post-signature grid--cell fl0">
        <div class="user-info ">
    <div class="user-action-time">
        answered <span title="2018-01-18 11:46:31Z" class="relativetime">Jan 18 '18 at 11:46</span>
    </div>
    <div class="user-gravatar32">
        <a href="/users/8149366/ankitbaldua"><div class="gravatar-wrapper-32"><img src="https://www.gravatar.com/avatar/ada2362a25d99e6c7981a51c3634e4fd?s=32&amp;d=identicon&amp;r=PG&amp;f=1" alt="" width="32" height="32" class="bar-sm"></div></a>
    </div>
    <div class="user-details" itemprop="author" itemscope itemtype="http://schema.org/Person">
        <a href="/users/8149366/ankitbaldua">ankitbaldua</a><span class="d-none" itemprop="name">ankitbaldua</span>
        <div class="-flair">
            <span class="reputation-score" title="reputation score " dir="ltr">205</span><span title="2 silver badges" aria-hidden="true"><span class="badge2"></span><span class="badgecount">2</span></span><span class="v-visible-sr">2 silver badges</span><span title="11 bronze badges" aria-hidden="true"><span class="badge3"></span><span class="badgecount">11</span></span><span class="v-visible-sr">11 bronze badges</span>
        </div>
    </div>
</div>

    </div>
    </div>
    
</div>


                <div class="post-layout--right">
        <div id="comments-48320592" class="comments js-comments-container bt bc-black-2 mt12  dno" data-post-id="48320592" data-min-length="15">
            <ul class="comments-list js-comments-list"
                    data-remaining-comments-count="0"
                    data-canpost="false"
                    data-cansee="true"
                    data-comments-unavailable="false"
                    data-addlink-disabled="true">

            </ul>
	    </div>

        <div id="comments-link-48320592" data-rep=50 data-anon=true>
                    <a class="js-add-link comments-link disabled-link" title="Use comments to ask for more information or suggest improvements. Say thanks by reacting to the answer."  href="#" role="button">add a comment</a>
                <span class="js-link-separator dno">&nbsp;|&nbsp;</span>
            <a class="js-show-link comments-link dno" title="expand to show all comments on this post" href=# onclick="" role="button"></a>
        </div>         
    </div>
    </div>
</div>

                                          
<a name="57071711"></a>
<div id="answer-57071711" class="answer" data-answerid="57071711"  itemprop="suggestedAnswer" itemscope itemtype="http://schema.org/Answer">
    <div class="post-layout">
        <div class="votecell post-layout--left">
            <div class="js-voting-container grid fd-column ai-stretch gs4 fc-black-200" data-post-id="57071711">
        <button class="js-vote-up-btn grid--cell s-btn s-btn__unset c-pointer" data-controller="s-tooltip" data-s-tooltip-placement="right" title="Upvote this answer if you find it clear and useful." aria-pressed="false" aria-label="Up vote" data-selected-classes="fc-theme-primary"><svg aria-hidden="true" class="m0 svg-icon iconArrowUpLg" width="36" height="36" viewBox="0 0 36 36"><path d="M2 26h32L18 10 2 26z"/></svg></button>
        <div class="js-vote-count grid--cell fc-black-500 fs-title grid fd-column ai-center" itemprop="upvoteCount" data-value="6">6</div>
        <button class="js-vote-down-btn grid--cell s-btn s-btn__unset c-pointer" data-controller="s-tooltip" data-s-tooltip-placement="right" title="Downvote this answer if you find it unclear or not useful." aria-pressed="false" aria-label="Down vote" data-selected-classes="fc-theme-primary"><svg aria-hidden="true" class="m0 svg-icon iconArrowDownLg" width="36" height="36" viewBox="0 0 36 36"><path d="M2 10h32L18 26 2 10z"/></svg></button>

    
            <div class="js-accepted-answer-indicator grid--cell fc-green-500 ta-center py4 d-none" data-s-tooltip-placement="right" title="Loading when this answer was accepted&#x2026;" tabindex="0" role="note" aria-label="Accepted">
                <svg aria-hidden="true" class="svg-icon iconCheckmarkLg" width="36" height="36" viewBox="0 0 36 36"><path d="M6 14l8 8L30 6v8L14 30l-8-8v-8z"/></svg>
            </div>

        
<div class="js-reactions grid--cell"
     data-controller="reactions"
     data-count="0"
     data-action="post:reactionsInit->reactions#updateUI">
        <button class="s-btn s-btn__unset w100 py4 c-pointer" aria-label="Thanks (0)" data-target="reactions.button" data-action="reactions#tryToggle keypress->reactions#tryToggle" aria-pressed="false"
                data-controller="s-tooltip" data-s-tooltip-placement="right" data-s-tooltip-html-title="Say &lt;b&gt;thanks&lt;/b&gt; for this answer."><svg aria-hidden="true" class="svg-icon iconHandsTogether" width="18" height="18" viewBox="0 0 18 18"><path d="M3.85 1.15a.5.5 0 10-.7.7l2 2a.5.5 0 10.7-.7l-2-2zM5.5 6h-2a.5.5 0 000 1h2a.5.5 0 000-1zm10 1h-2a.5.5 0 010-1h2a.5.5 0 010 1zm.35-5.15a.5.5 0 00-.7-.7l-2 2a.5.5 0 00.7.7l2-2z" opacity=".4"/><path d="M8.21 16.49c-.44.37-1.02.55-1.6.51H5v-6h2l1-7.63c0-.2.23-.37.5-.37s.5.17.5.37V15a2.23 2.23 0 01-.79 1.49zm2.58 0c.44.37 1.02.55 1.6.51H14v-6h-2l-1-7.63c0-.2-.23-.37-.5-.37s-.5.17-.5.37V15c.06.58.34 1.11.79 1.49z" fill="#FFC166"/><path d="M2.5 11c-.83 0-1.5.67-1.5 1.5v3c0 .83.67 1.5 1.5 1.5H4v-6H2.5zm14 0H15v6h1.5c.83 0 1.5-.67 1.5-1.5v-3c0-.83-.67-1.5-1.5-1.5z" opacity=".7" fill="#07C"/></svg></button>
        <div class="ta-center fc-black-200 d-none" data-target="reactions.count"
             data-controller="s-tooltip" data-s-tooltip-placement="right" data-s-tooltip-html-title="0 others reacted with &lt;b&gt;thanks&lt;/b&gt;.">0</div>
</div>

    
        <a class="js-post-issue grid--cell s-btn s-btn__unset c-pointer py6 mx-auto" href="/posts/57071711/timeline" data-shortcut="T" data-controller="s-tooltip" data-s-tooltip-placement="right" title="Show activity on this post." aria-label="Timeline"><svg aria-hidden="true" class="mln2 mr0 svg-icon iconHistory" width="19" height="18" viewBox="0 0 19 18"><path d="M3 9a8 8 0 113.73 6.77L8.2 14.3A6 6 0 105 9l3.01-.01-4 4-4-4h3L3 9zm7-4h1.01L11 9.36l3.22 2.1-.6.93L10 10V5z"/></svg></a>

</div>

        </div>

        

<div class="answercell post-layout--right">
    
    <div class="post-text" itemprop="text">
<p>I use the following formulation:</p>

<pre><code>TODAY=`date -I`
echo $TODAY
</code></pre>

<p>Checkout the man page for <code>date</code>, there is a number of other useful options:</p>

<pre><code>man date
</code></pre>
    </div>
    <div class="grid mb0 fw-wrap ai-start jc-end gs8 gsy">
        <time itemprop="dateCreated" datetime="2019-07-17T08:31:12"></time>
        <div class="grid--cell mr16" style="flex: 1 1 100px;">
            

<div class="post-menu">
    <a href="/a/57071711"
       rel="nofollow"
       itemprop="url"
       class="js-share-link js-gps-track"
       title="short permalink to this answer"
       data-gps-track="post.click({ item: 2, priv: 0, post_type: 2 })"
       data-controller="se-share-sheet"
       data-se-share-sheet-title="Share a link to this answer"
       data-se-share-sheet-subtitle=""
       data-se-share-sheet-post-type="answer"
       data-se-share-sheet-social="facebook twitter devto"
       data-se-share-sheet-location="2"
       data-se-share-sheet-license-url="https%3a%2f%2fcreativecommons.org%2flicenses%2fby-sa%2f4.0%2f"
       data-se-share-sheet-license-name="CC BY-SA 4.0"
       data-s-popover-placement="bottom-start">share</a>
        <span class="lsep">|</span>
                <a href="/posts/57071711/edit" class="suggest-edit-post js-gps-track" data-gps-track="post.click({ item: 6, priv: 0, post_type: 2 })" title="">improve this answer</a>
        <span class="lsep">|</span>
    <button id="btnFollowPost-57071711" class="s-btn s-btn__link fc-black-400 h:fc-black-700 pb2 js-follow-post js-follow-answer js-gps-track" role="button"
            data-gps-track="post.click({ item: 14, priv: 0, post_type: 2 })"
            data-controller="s-tooltip " data-s-tooltip-placement="bottom"
            data-s-popover-placement="bottom" aria-controls=""
            title="Follow this answer to receive notifications">
        follow
    </button>
        <span class="lsep">|</span>
</div>

        </div>


    <div class="post-signature grid--cell fl0">
        <div class="user-info user-hover">
    <div class="user-action-time">
        answered <span title="2019-07-17 08:31:12Z" class="relativetime">Jul 17 '19 at 8:31</span>
    </div>
    <div class="user-gravatar32">
        <a href="/users/2066215/lu%c3%ads-de-sousa"><div class="gravatar-wrapper-32"><img src="https://i.stack.imgur.com/Ie7AP.jpg?s=32&amp;g=1" alt="" width="32" height="32" class="bar-sm"></div></a>
    </div>
    <div class="user-details" itemprop="author" itemscope itemtype="http://schema.org/Person">
        <a href="/users/2066215/lu%c3%ads-de-sousa">Lu&#237;s de Sousa</a><span class="d-none" itemprop="name">Lu&#237;s de Sousa</span>
        <div class="-flair">
            <span class="reputation-score" title="reputation score " dir="ltr">3,080</span><span title="5 gold badges" aria-hidden="true"><span class="badge1"></span><span class="badgecount">5</span></span><span class="v-visible-sr">5 gold badges</span><span title="32 silver badges" aria-hidden="true"><span class="badge2"></span><span class="badgecount">32</span></span><span class="v-visible-sr">32 silver badges</span><span title="65 bronze badges" aria-hidden="true"><span class="badge3"></span><span class="badgecount">65</span></span><span class="v-visible-sr">65 bronze badges</span>
        </div>
    </div>
</div>

    </div>
    </div>
    
</div>


                <div class="post-layout--right">
        <div id="comments-57071711" class="comments js-comments-container bt bc-black-2 mt12  dno" data-post-id="57071711" data-min-length="15">
            <ul class="comments-list js-comments-list"
                    data-remaining-comments-count="0"
                    data-canpost="false"
                    data-cansee="true"
                    data-comments-unavailable="false"
                    data-addlink-disabled="true">

            </ul>
	    </div>

        <div id="comments-link-57071711" data-rep=50 data-anon=true>
                    <a class="js-add-link comments-link disabled-link" title="Use comments to ask for more information or suggest improvements. Say thanks by reacting to the answer."  href="#" role="button">add a comment</a>
                <span class="js-link-separator dno">&nbsp;|&nbsp;</span>
            <a class="js-show-link comments-link dno" title="expand to show all comments on this post" href=# onclick="" role="button"></a>
        </div>         
    </div>
    </div>
</div>

                                          
<a name="54407161"></a>
<div id="answer-54407161" class="answer" data-answerid="54407161"  itemprop="suggestedAnswer" itemscope itemtype="http://schema.org/Answer">
    <div class="post-layout">
        <div class="votecell post-layout--left">
            <div class="js-voting-container grid fd-column ai-stretch gs4 fc-black-200" data-post-id="54407161">
        <button class="js-vote-up-btn grid--cell s-btn s-btn__unset c-pointer" data-controller="s-tooltip" data-s-tooltip-placement="right" title="Upvote this answer if you find it clear and useful." aria-pressed="false" aria-label="Up vote" data-selected-classes="fc-theme-primary"><svg aria-hidden="true" class="m0 svg-icon iconArrowUpLg" width="36" height="36" viewBox="0 0 36 36"><path d="M2 26h32L18 10 2 26z"/></svg></button>
        <div class="js-vote-count grid--cell fc-black-500 fs-title grid fd-column ai-center" itemprop="upvoteCount" data-value="5">5</div>
        <button class="js-vote-down-btn grid--cell s-btn s-btn__unset c-pointer" data-controller="s-tooltip" data-s-tooltip-placement="right" title="Downvote this answer if you find it unclear or not useful." aria-pressed="false" aria-label="Down vote" data-selected-classes="fc-theme-primary"><svg aria-hidden="true" class="m0 svg-icon iconArrowDownLg" width="36" height="36" viewBox="0 0 36 36"><path d="M2 10h32L18 26 2 10z"/></svg></button>

    
            <div class="js-accepted-answer-indicator grid--cell fc-green-500 ta-center py4 d-none" data-s-tooltip-placement="right" title="Loading when this answer was accepted&#x2026;" tabindex="0" role="note" aria-label="Accepted">
                <svg aria-hidden="true" class="svg-icon iconCheckmarkLg" width="36" height="36" viewBox="0 0 36 36"><path d="M6 14l8 8L30 6v8L14 30l-8-8v-8z"/></svg>
            </div>

        
<div class="js-reactions grid--cell"
     data-controller="reactions"
     data-count="0"
     data-action="post:reactionsInit->reactions#updateUI">
        <button class="s-btn s-btn__unset w100 py4 c-pointer" aria-label="Thanks (0)" data-target="reactions.button" data-action="reactions#tryToggle keypress->reactions#tryToggle" aria-pressed="false"
                data-controller="s-tooltip" data-s-tooltip-placement="right" data-s-tooltip-html-title="Say &lt;b&gt;thanks&lt;/b&gt; for this answer."><svg aria-hidden="true" class="svg-icon iconHandsTogether" width="18" height="18" viewBox="0 0 18 18"><path d="M3.85 1.15a.5.5 0 10-.7.7l2 2a.5.5 0 10.7-.7l-2-2zM5.5 6h-2a.5.5 0 000 1h2a.5.5 0 000-1zm10 1h-2a.5.5 0 010-1h2a.5.5 0 010 1zm.35-5.15a.5.5 0 00-.7-.7l-2 2a.5.5 0 00.7.7l2-2z" opacity=".4"/><path d="M8.21 16.49c-.44.37-1.02.55-1.6.51H5v-6h2l1-7.63c0-.2.23-.37.5-.37s.5.17.5.37V15a2.23 2.23 0 01-.79 1.49zm2.58 0c.44.37 1.02.55 1.6.51H14v-6h-2l-1-7.63c0-.2-.23-.37-.5-.37s-.5.17-.5.37V15c.06.58.34 1.11.79 1.49z" fill="#FFC166"/><path d="M2.5 11c-.83 0-1.5.67-1.5 1.5v3c0 .83.67 1.5 1.5 1.5H4v-6H2.5zm14 0H15v6h1.5c.83 0 1.5-.67 1.5-1.5v-3c0-.83-.67-1.5-1.5-1.5z" opacity=".7" fill="#07C"/></svg></button>
        <div class="ta-center fc-black-200 d-none" data-target="reactions.count"
             data-controller="s-tooltip" data-s-tooltip-placement="right" data-s-tooltip-html-title="0 others reacted with &lt;b&gt;thanks&lt;/b&gt;.">0</div>
</div>

    
        <a class="js-post-issue grid--cell s-btn s-btn__unset c-pointer py6 mx-auto" href="/posts/54407161/timeline" data-shortcut="T" data-controller="s-tooltip" data-s-tooltip-placement="right" title="Show activity on this post." aria-label="Timeline"><svg aria-hidden="true" class="mln2 mr0 svg-icon iconHistory" width="19" height="18" viewBox="0 0 19 18"><path d="M3 9a8 8 0 113.73 6.77L8.2 14.3A6 6 0 105 9l3.01-.01-4 4-4-4h3L3 9zm7-4h1.01L11 9.36l3.22 2.1-.6.93L10 10V5z"/></svg></a>

</div>

        </div>

        

<div class="answercell post-layout--right">
    
    <div class="post-text" itemprop="text">
<p>I use <code>$(date +"%Y-%m-%d")</code>  or <code>$(date +"%Y-%m-%d %T")</code> with time and hours.</p>
    </div>
    <div class="grid mb0 fw-wrap ai-start jc-end gs8 gsy">
        <time itemprop="dateCreated" datetime="2019-01-28T17:18:01"></time>
        <div class="grid--cell mr16" style="flex: 1 1 100px;">
            

<div class="post-menu">
    <a href="/a/54407161"
       rel="nofollow"
       itemprop="url"
       class="js-share-link js-gps-track"
       title="short permalink to this answer"
       data-gps-track="post.click({ item: 2, priv: 0, post_type: 2 })"
       data-controller="se-share-sheet"
       data-se-share-sheet-title="Share a link to this answer"
       data-se-share-sheet-subtitle=""
       data-se-share-sheet-post-type="answer"
       data-se-share-sheet-social="facebook twitter devto"
       data-se-share-sheet-location="2"
       data-se-share-sheet-license-url="https%3a%2f%2fcreativecommons.org%2flicenses%2fby-sa%2f4.0%2f"
       data-se-share-sheet-license-name="CC BY-SA 4.0"
       data-s-popover-placement="bottom-start">share</a>
        <span class="lsep">|</span>
                <a href="/posts/54407161/edit" class="suggest-edit-post js-gps-track" data-gps-track="post.click({ item: 6, priv: 0, post_type: 2 })" title="">improve this answer</a>
        <span class="lsep">|</span>
    <button id="btnFollowPost-54407161" class="s-btn s-btn__link fc-black-400 h:fc-black-700 pb2 js-follow-post js-follow-answer js-gps-track" role="button"
            data-gps-track="post.click({ item: 14, priv: 0, post_type: 2 })"
            data-controller="s-tooltip " data-s-tooltip-placement="bottom"
            data-s-popover-placement="bottom" aria-controls=""
            title="Follow this answer to receive notifications">
        follow
    </button>
        <span class="lsep">|</span>
</div>

        </div>
    <div class="post-signature grid--cell fl0">
<div class="user-info user-hover">
    <div class="user-action-time">
        <a href="/posts/54407161/revisions" title="show all edits to this post"
                         class="js-gps-track"
                         data-gps-track="post.click({ item: 4, priv: 0, post_type: 2 })">edited <span title="2019-06-12 12:22:19Z" class="relativetime">Jun 12 '19 at 12:22</span></a>
    </div>
    <div class="user-gravatar32">
        <a href="/users/7611062/treybake"><div class="gravatar-wrapper-32"><img src="https://i.stack.imgur.com/jgqAm.png?s=32&amp;g=1" alt="" width="32" height="32" class="bar-sm"></div></a>
    </div>
    <div class="user-details">
        <a href="/users/7611062/treybake">treyBake</a>
        <div class="-flair">
            <span class="reputation-score" title="reputation score " dir="ltr">5,901</span><span title="5 gold badges" aria-hidden="true"><span class="badge1"></span><span class="badgecount">5</span></span><span class="v-visible-sr">5 gold badges</span><span title="19 silver badges" aria-hidden="true"><span class="badge2"></span><span class="badgecount">19</span></span><span class="v-visible-sr">19 silver badges</span><span title="45 bronze badges" aria-hidden="true"><span class="badge3"></span><span class="badgecount">45</span></span><span class="v-visible-sr">45 bronze badges</span>
        </div>
    </div>
</div>    </div>


    <div class="post-signature grid--cell fl0">
        <div class="user-info user-hover">
    <div class="user-action-time">
        answered <span title="2019-01-28 17:18:01Z" class="relativetime">Jan 28 '19 at 17:18</span>
    </div>
    <div class="user-gravatar32">
        <a href="/users/1834212/miguel"><div class="gravatar-wrapper-32"><img src="https://www.gravatar.com/avatar/2e6ad60d1fe6c4f876a0b0ef400597a2?s=32&amp;d=identicon&amp;r=PG" alt="" width="32" height="32" class="bar-sm"></div></a>
    </div>
    <div class="user-details" itemprop="author" itemscope itemtype="http://schema.org/Person">
        <a href="/users/1834212/miguel">Miguel</a><span class="d-none" itemprop="name">Miguel</span>
        <div class="-flair">
            <span class="reputation-score" title="reputation score " dir="ltr">2,071</span><span title="1 gold badge" aria-hidden="true"><span class="badge1"></span><span class="badgecount">1</span></span><span class="v-visible-sr">1 gold badge</span><span title="24 silver badges" aria-hidden="true"><span class="badge2"></span><span class="badgecount">24</span></span><span class="v-visible-sr">24 silver badges</span><span title="24 bronze badges" aria-hidden="true"><span class="badge3"></span><span class="badgecount">24</span></span><span class="v-visible-sr">24 bronze badges</span>
        </div>
    </div>
</div>

    </div>
    </div>
    
</div>


                <div class="post-layout--right">
        <div id="comments-54407161" class="comments js-comments-container bt bc-black-2 mt12  dno" data-post-id="54407161" data-min-length="15">
            <ul class="comments-list js-comments-list"
                    data-remaining-comments-count="0"
                    data-canpost="false"
                    data-cansee="true"
                    data-comments-unavailable="false"
                    data-addlink-disabled="true">

            </ul>
	    </div>

        <div id="comments-link-54407161" data-rep=50 data-anon=true>
                    <a class="js-add-link comments-link disabled-link" title="Use comments to ask for more information or suggest improvements. Say thanks by reacting to the answer."  href="#" role="button">add a comment</a>
                <span class="js-link-separator dno">&nbsp;|&nbsp;</span>
            <a class="js-show-link comments-link dno" title="expand to show all comments on this post" href=# onclick="" role="button"></a>
        </div>         
    </div>
    </div>
</div>

                                          
<a name="53929515"></a>
<div id="answer-53929515" class="answer" data-answerid="53929515"  itemprop="suggestedAnswer" itemscope itemtype="http://schema.org/Answer">
    <div class="post-layout">
        <div class="votecell post-layout--left">
            <div class="js-voting-container grid fd-column ai-stretch gs4 fc-black-200" data-post-id="53929515">
        <button class="js-vote-up-btn grid--cell s-btn s-btn__unset c-pointer" data-controller="s-tooltip" data-s-tooltip-placement="right" title="Upvote this answer if you find it clear and useful." aria-pressed="false" aria-label="Up vote" data-selected-classes="fc-theme-primary"><svg aria-hidden="true" class="m0 svg-icon iconArrowUpLg" width="36" height="36" viewBox="0 0 36 36"><path d="M2 26h32L18 10 2 26z"/></svg></button>
        <div class="js-vote-count grid--cell fc-black-500 fs-title grid fd-column ai-center" itemprop="upvoteCount" data-value="1">1</div>
        <button class="js-vote-down-btn grid--cell s-btn s-btn__unset c-pointer" data-controller="s-tooltip" data-s-tooltip-placement="right" title="Downvote this answer if you find it unclear or not useful." aria-pressed="false" aria-label="Down vote" data-selected-classes="fc-theme-primary"><svg aria-hidden="true" class="m0 svg-icon iconArrowDownLg" width="36" height="36" viewBox="0 0 36 36"><path d="M2 10h32L18 26 2 10z"/></svg></button>

    
            <div class="js-accepted-answer-indicator grid--cell fc-green-500 ta-center py4 d-none" data-s-tooltip-placement="right" title="Loading when this answer was accepted&#x2026;" tabindex="0" role="note" aria-label="Accepted">
                <svg aria-hidden="true" class="svg-icon iconCheckmarkLg" width="36" height="36" viewBox="0 0 36 36"><path d="M6 14l8 8L30 6v8L14 30l-8-8v-8z"/></svg>
            </div>

        
<div class="js-reactions grid--cell"
     data-controller="reactions"
     data-count="0"
     data-action="post:reactionsInit->reactions#updateUI">
        <button class="s-btn s-btn__unset w100 py4 c-pointer" aria-label="Thanks (0)" data-target="reactions.button" data-action="reactions#tryToggle keypress->reactions#tryToggle" aria-pressed="false"
                data-controller="s-tooltip" data-s-tooltip-placement="right" data-s-tooltip-html-title="Say &lt;b&gt;thanks&lt;/b&gt; for this answer."><svg aria-hidden="true" class="svg-icon iconHandsTogether" width="18" height="18" viewBox="0 0 18 18"><path d="M3.85 1.15a.5.5 0 10-.7.7l2 2a.5.5 0 10.7-.7l-2-2zM5.5 6h-2a.5.5 0 000 1h2a.5.5 0 000-1zm10 1h-2a.5.5 0 010-1h2a.5.5 0 010 1zm.35-5.15a.5.5 0 00-.7-.7l-2 2a.5.5 0 00.7.7l2-2z" opacity=".4"/><path d="M8.21 16.49c-.44.37-1.02.55-1.6.51H5v-6h2l1-7.63c0-.2.23-.37.5-.37s.5.17.5.37V15a2.23 2.23 0 01-.79 1.49zm2.58 0c.44.37 1.02.55 1.6.51H14v-6h-2l-1-7.63c0-.2-.23-.37-.5-.37s-.5.17-.5.37V15c.06.58.34 1.11.79 1.49z" fill="#FFC166"/><path d="M2.5 11c-.83 0-1.5.67-1.5 1.5v3c0 .83.67 1.5 1.5 1.5H4v-6H2.5zm14 0H15v6h1.5c.83 0 1.5-.67 1.5-1.5v-3c0-.83-.67-1.5-1.5-1.5z" opacity=".7" fill="#07C"/></svg></button>
        <div class="ta-center fc-black-200 d-none" data-target="reactions.count"
             data-controller="s-tooltip" data-s-tooltip-placement="right" data-s-tooltip-html-title="0 others reacted with &lt;b&gt;thanks&lt;/b&gt;.">0</div>
</div>

    
        <a class="js-post-issue grid--cell s-btn s-btn__unset c-pointer py6 mx-auto" href="/posts/53929515/timeline" data-shortcut="T" data-controller="s-tooltip" data-s-tooltip-placement="right" title="Show activity on this post." aria-label="Timeline"><svg aria-hidden="true" class="mln2 mr0 svg-icon iconHistory" width="19" height="18" viewBox="0 0 19 18"><path d="M3 9a8 8 0 113.73 6.77L8.2 14.3A6 6 0 105 9l3.01-.01-4 4-4-4h3L3 9zm7-4h1.01L11 9.36l3.22 2.1-.6.93L10 10V5z"/></svg></a>

</div>

        </div>

        

<div class="answercell post-layout--right">
    
    <div class="post-text" itemprop="text">
<p>You can set date as environment variable and later u can use it</p>

<pre><code>setenv DATE `date "+%Y-%m-%d"`
echo "----------- ${DATE} -------------"
</code></pre>

<p>or </p>

<pre><code>DATE =`date "+%Y-%m-%d"`
echo "----------- ${DATE} -------------"
</code></pre>
    </div>
    <div class="grid mb0 fw-wrap ai-start jc-end gs8 gsy">
        <time itemprop="dateCreated" datetime="2018-12-26T08:38:23"></time>
        <div class="grid--cell mr16" style="flex: 1 1 100px;">
            

<div class="post-menu">
    <a href="/a/53929515"
       rel="nofollow"
       itemprop="url"
       class="js-share-link js-gps-track"
       title="short permalink to this answer"
       data-gps-track="post.click({ item: 2, priv: 0, post_type: 2 })"
       data-controller="se-share-sheet"
       data-se-share-sheet-title="Share a link to this answer"
       data-se-share-sheet-subtitle=""
       data-se-share-sheet-post-type="answer"
       data-se-share-sheet-social="facebook twitter devto"
       data-se-share-sheet-location="2"
       data-se-share-sheet-license-url="https%3a%2f%2fcreativecommons.org%2flicenses%2fby-sa%2f4.0%2f"
       data-se-share-sheet-license-name="CC BY-SA 4.0"
       data-s-popover-placement="bottom-start">share</a>
        <span class="lsep">|</span>
                <a href="/posts/53929515/edit" class="suggest-edit-post js-gps-track" data-gps-track="post.click({ item: 6, priv: 0, post_type: 2 })" title="">improve this answer</a>
        <span class="lsep">|</span>
    <button id="btnFollowPost-53929515" class="s-btn s-btn__link fc-black-400 h:fc-black-700 pb2 js-follow-post js-follow-answer js-gps-track" role="button"
            data-gps-track="post.click({ item: 14, priv: 0, post_type: 2 })"
            data-controller="s-tooltip " data-s-tooltip-placement="bottom"
            data-s-popover-placement="bottom" aria-controls=""
            title="Follow this answer to receive notifications">
        follow
    </button>
        <span class="lsep">|</span>
</div>

        </div>


    <div class="post-signature grid--cell fl0">
        <div class="user-info ">
    <div class="user-action-time">
        answered <span title="2018-12-26 08:38:23Z" class="relativetime">Dec 26 '18 at 8:38</span>
    </div>
    <div class="user-gravatar32">
        <a href="/users/3838901/farid-haq"><div class="gravatar-wrapper-32"><img src="https://www.gravatar.com/avatar/24b60dd0d6855072619355ca3b9e09e1?s=32&amp;d=identicon&amp;r=PG&amp;f=1" alt="" width="32" height="32" class="bar-sm"></div></a>
    </div>
    <div class="user-details" itemprop="author" itemscope itemtype="http://schema.org/Person">
        <a href="/users/3838901/farid-haq">Farid Haq</a><span class="d-none" itemprop="name">Farid Haq</span>
        <div class="-flair">
            <span class="reputation-score" title="reputation score " dir="ltr">1,286</span><span title="9 silver badges" aria-hidden="true"><span class="badge2"></span><span class="badgecount">9</span></span><span class="v-visible-sr">9 silver badges</span><span title="10 bronze badges" aria-hidden="true"><span class="badge3"></span><span class="badgecount">10</span></span><span class="v-visible-sr">10 bronze badges</span>
        </div>
    </div>
</div>

    </div>
    </div>
    
</div>


                <div class="post-layout--right">
        <div id="comments-53929515" class="comments js-comments-container bt bc-black-2 mt12  dno" data-post-id="53929515" data-min-length="15">
            <ul class="comments-list js-comments-list"
                    data-remaining-comments-count="0"
                    data-canpost="false"
                    data-cansee="true"
                    data-comments-unavailable="false"
                    data-addlink-disabled="true">

            </ul>
	    </div>

        <div id="comments-link-53929515" data-rep=50 data-anon=true>
                    <a class="js-add-link comments-link disabled-link" title="Use comments to ask for more information or suggest improvements. Say thanks by reacting to the answer."  href="#" role="button">add a comment</a>
                <span class="js-link-separator dno">&nbsp;|&nbsp;</span>
            <a class="js-show-link comments-link dno" title="expand to show all comments on this post" href=# onclick="" role="button"></a>
        </div>         
    </div>
    </div>
</div>


                                <aside class="s-notice s-notice__info js-post-notice mb16" role="status">
        <div class="grid fd-column fw-nowrap">
            <div class="grid fw-nowrap">
                    <div class="grid--cell mr8">
                        <svg aria-hidden="true" class="svg-icon iconFire" width="18" height="18" viewBox="0 0 18 18"><path opacity=".6" d="M13.18 9c-.8.33-1.46.6-1.97 1.3A9.21 9.21 0 0010 13.89a10 10 0 001.32-.8 2.53 2.53 0 01-.63 2.91h.78a3 3 0 001.66-.5 4.15 4.15 0 001.26-1.61c.4-.96.47-1.7.55-2.73.05-1.24-.1-2.49-.46-3.68a2 2 0 01-.4.91 2.1 2.1 0 01-.9.62z" fill="#FF6700"/><path d="M10.4 12.11a7.1 7.1 0 01.78-1.76c.3-.47.81-.8 1.37-1.08 0 0-.05-3.27-1.55-5.27-1.5-2-3.37-2.75-4.95-2.61 0 0 3.73 2.42.72 5.15C4.63 8.45 3.59 10.87 4.13 13a4.14 4.14 0 003.1 3 4.05 4.05 0 011.08-3.89C9.42 10.92 8 9.79 8 9.79c.67.02 1.3.28 1.81.72a2 2 0 01.58 1.6z" fill="#EF2E2E"/></svg>
                    </div>
                <div class="grid--cell fl1 lh-lg">
                    <div class="grid--cell fl1 lh-lg">
                        <b><a href="/help/privileges/protect-questions">Highly active question</a></b>. Earn 10 reputation in order to answer this question. The reputation requirement helps protect this question from spam and non-answer activity.
                        
                    </div>
                </div>
            </div>
        </div>
</aside>




                            <h2 class="bottom-notice" data-loc="1">
Not the answer you&#x27;re looking for? Browse other questions tagged <a href="/questions/tagged/bash" class="post-tag" title="show questions tagged &#39;bash&#39;" rel="tag">bash</a> <a href="/questions/tagged/shell" class="post-tag" title="show questions tagged &#39;shell&#39;" rel="tag">shell</a> <a href="/questions/tagged/date" class="post-tag" title="show questions tagged &#39;date&#39;" rel="tag">date</a> <a href="/questions/tagged/strftime" class="post-tag" title="show questions tagged &#39;strftime&#39;" rel="tag">strftime</a>  or <a href="/questions/ask">ask your own question</a>.                            </h2>
                </div>
            </div>
            <div id="sidebar" class="show-votes" role="complementary" aria-label="sidebar">
                
<div class="s-sidebarwidget s-sidebarwidget__yellow s-anchors s-anchors__grayscale mb16" data-tracker="cb=1">
                <div class="s-sidebarwidget--header s-sidebarwidget__small-bold-text fc-light d:fc-black-900">
                    The Overflow Blog
                </div>
            <ul class="s-sidebarwidget--content s-sidebarwidget__items pt0 pr16 pb0 pl16">
    <li class="s-sidebarwidget--item grid">
        <div class="grid--cell1 fl-shrink0">
                <a href="https://stackoverflow.blog/2020/06/19/podcast-245-it-aint-real-till-you-break-prod/" data-ga="[&quot;community bulletin board&quot;,&quot;The Overflow Blog&quot;,&quot;https://stackoverflow.blog/2020/06/19/podcast-245-it-aint-real-till-you-break-prod/&quot;,null,null]">
<svg aria-hidden="true" class="va-text-top svg-icon iconPencilSm" width="14" height="14" viewBox="0 0 14 14"><path d="M11.1 1.71l1.13 1.12c.2.2.2.51 0 .71L11.1 4.7 9.21 2.86l1.17-1.15c.2-.2.51-.2.71 0zM2 10.12l6.37-6.43 1.88 1.88L3.88 12H2v-1.88z"/></svg>                </a>
        </div>
        <div class="grid--cell">
            <a href="https://stackoverflow.blog/2020/06/19/podcast-245-it-aint-real-till-you-break-prod/" class="js-gps-track" data-ga="[&quot;community bulletin board&quot;,&quot;The Overflow Blog&quot;,&quot;https://stackoverflow.blog/2020/06/19/podcast-245-it-aint-real-till-you-break-prod/&quot;,null,null]" data-gps-track="communitybulletin.click({ priority: 1, position: 0 })">Podcast 245: It ain’t real till you break Prod</a>
        </div>
    </li>
            </ul>
            <ul class="s-sidebarwidget--content s-sidebarwidget__items pt0 pr16 pb0 pl16">
    <li class="s-sidebarwidget--item grid">
        <div class="grid--cell1 fl-shrink0">
                <a href="https://stackoverflow.blog/2020/06/19/16125/" data-ga="[&quot;community bulletin board&quot;,&quot;The Overflow Blog&quot;,&quot;https://stackoverflow.blog/2020/06/19/16125/&quot;,null,null]">
<svg aria-hidden="true" class="va-text-top svg-icon iconPencilSm" width="14" height="14" viewBox="0 0 14 14"><path d="M11.1 1.71l1.13 1.12c.2.2.2.51 0 .71L11.1 4.7 9.21 2.86l1.17-1.15c.2-.2.51-.2.71 0zM2 10.12l6.37-6.43 1.88 1.88L3.88 12H2v-1.88z"/></svg>                </a>
        </div>
        <div class="grid--cell">
            <a href="https://stackoverflow.blog/2020/06/19/16125/" class="js-gps-track" data-ga="[&quot;community bulletin board&quot;,&quot;The Overflow Blog&quot;,&quot;https://stackoverflow.blog/2020/06/19/16125/&quot;,null,null]" data-gps-track="communitybulletin.click({ priority: 1, position: 1 })">The Overflow #26: The next right thing</a>
        </div>
    </li>
            </ul>
                <div class="s-sidebarwidget--header s-sidebarwidget__small-bold-text fc-light d:fc-black-900">
                    Featured on Meta
                </div>
            <ul class="s-sidebarwidget--content s-sidebarwidget__items pt0 pr16 pb0 pl16">
    <li class="s-sidebarwidget--item grid">
        <div class="grid--cell1 fl-shrink0">
                <a href="https://meta.stackexchange.com/questions/348746/were-switching-to-commonmark" data-ga="[&quot;community bulletin board&quot;,&quot;Featured on Meta&quot;,&quot;https://meta.stackexchange.com/questions/348746/were-switching-to-commonmark&quot;,null,null]">
<div class="favicon favicon-stackexchangemeta" title="Meta Stack Exchange"></div>                </a>
        </div>
        <div class="grid--cell">
            <a href="https://meta.stackexchange.com/questions/348746/were-switching-to-commonmark" class="js-gps-track" data-ga="[&quot;community bulletin board&quot;,&quot;Featured on Meta&quot;,&quot;https://meta.stackexchange.com/questions/348746/were-switching-to-commonmark&quot;,null,null]" data-gps-track="communitybulletin.click({ priority: 3, position: 2 })">We&#39;re switching to CommonMark</a>
        </div>
    </li>
            </ul>
            <ul class="s-sidebarwidget--content s-sidebarwidget__items pt0 pr16 pb0 pl16">
    <li class="s-sidebarwidget--item grid">
        <div class="grid--cell1 fl-shrink0">
                <a href="https://meta.stackexchange.com/questions/349276/new-post-lock-available-on-meta-sites-policy-lock" data-ga="[&quot;community bulletin board&quot;,&quot;Featured on Meta&quot;,&quot;https://meta.stackexchange.com/questions/349276/new-post-lock-available-on-meta-sites-policy-lock&quot;,null,null]">
<div class="favicon favicon-stackexchangemeta" title="Meta Stack Exchange"></div>                </a>
        </div>
        <div class="grid--cell">
            <a href="https://meta.stackexchange.com/questions/349276/new-post-lock-available-on-meta-sites-policy-lock" class="js-gps-track" data-ga="[&quot;community bulletin board&quot;,&quot;Featured on Meta&quot;,&quot;https://meta.stackexchange.com/questions/349276/new-post-lock-available-on-meta-sites-policy-lock&quot;,null,null]" data-gps-track="communitybulletin.click({ priority: 3, position: 3 })">New post lock available on meta sites: Policy Lock</a>
        </div>
    </li>
            </ul>
            <ul class="s-sidebarwidget--content s-sidebarwidget__items pt0 pr16 pb0 pl16">
    <li class="s-sidebarwidget--item grid">
        <div class="grid--cell1 fl-shrink0">
                <a href="https://meta.stackoverflow.com/questions/398367/feature-test-thank-you-reaction" data-ga="[&quot;community bulletin board&quot;,&quot;Featured on Meta&quot;,&quot;https://meta.stackoverflow.com/questions/398367/feature-test-thank-you-reaction&quot;,null,null]">
<div class="favicon favicon-stackoverflowmeta" title="Meta Stack Overflow"></div>                </a>
        </div>
        <div class="grid--cell">
            <a href="https://meta.stackoverflow.com/questions/398367/feature-test-thank-you-reaction" class="js-gps-track" data-ga="[&quot;community bulletin board&quot;,&quot;Featured on Meta&quot;,&quot;https://meta.stackoverflow.com/questions/398367/feature-test-thank-you-reaction&quot;,null,null]" data-gps-track="communitybulletin.click({ priority: 6, position: 4 })">Feature test: Thank you reaction</a>
        </div>
    </li>
            </ul>
</div>


<div id="dfp-tsb" class="everyonelovesstackoverflow everyoneloves__top-sidebar mb8"></div>
<div id="dfp-msb" class="everyonelovesstackoverflow everyoneloves__mid-sidebar mb8"></div>
<div id="hireme"></div>
                
                <div class="module sidebar-linked">
	<h4 id="h-linked">Linked</h4>
	<div class="linked" data-tracker="lq=1">
		    
<div class="spacer js-gps-track" data-gps-track="linkedquestion.click({ source_post_id: 1401482, target_question_id: 32161888, position: 0 })">
	<a href="/q/32161888" title="Vote score (upvotes - downvotes)">
		<div class="answer-votes answered-accepted default">7</div>
	</a>
	<a href="/questions/32161888/get-the-current-year-on-the-commandline?noredirect=1" class="question-hyperlink">Get the current year on the commandline</a>
</div>
		    
<div class="spacer js-gps-track" data-gps-track="linkedquestion.click({ source_post_id: 1401482, target_question_id: 51317904, position: 1 })">
	<a href="/q/51317904" title="Vote score (upvotes - downvotes)">
		<div class="answer-votes answered-accepted default">-1</div>
	</a>
	<a href="/questions/51317904/date-with-specific-format-like-yy-mm-dd?noredirect=1" class="question-hyperlink">Date with specific format like YY-MM-DD</a>
</div>
		    
<div class="spacer js-gps-track" data-gps-track="linkedquestion.click({ source_post_id: 1401482, target_question_id: 56433440, position: 2 })">
	<a href="/q/56433440" title="Vote score (upvotes - downvotes)">
		<div class="answer-votes  default">-1</div>
	</a>
	<a href="/questions/56433440/how-to-print-02-jun-2019-in-bash?noredirect=1" class="question-hyperlink">How to print 02-Jun-2019 in bash</a>
</div>
		    
<div class="spacer js-gps-track" data-gps-track="linkedquestion.click({ source_post_id: 1401482, target_question_id: 54084542, position: 3 })">
	<a href="/q/54084542" title="Vote score (upvotes - downvotes)">
		<div class="answer-votes  default">-1</div>
	</a>
	<a href="/questions/54084542/question-about-the-meaning-of-backtick-and-string?noredirect=1" class="question-hyperlink">Question about the meaning of backtick and %string</a>
</div>
		    
<div class="spacer js-gps-track" data-gps-track="linkedquestion.click({ source_post_id: 1401482, target_question_id: 13533661, position: 4 })">
	<a href="/q/13533661" title="Vote score (upvotes - downvotes)">
		<div class="answer-votes answered-accepted default">34</div>
	</a>
	<a href="/questions/13533661/todays-date-minus-x-days-in-shell-script?noredirect=1" class="question-hyperlink">Today&#39;s date, minus X days in shell script</a>
</div>
		    
<div class="spacer js-gps-track" data-gps-track="linkedquestion.click({ source_post_id: 1401482, target_question_id: 39033693, position: 5 })">
	<a href="/q/39033693" title="Vote score (upvotes - downvotes)">
		<div class="answer-votes answered-accepted default">4</div>
	</a>
	<a href="/questions/39033693/how-to-check-whether-the-file-exist-in-hdfs-location-using-oozie?noredirect=1" class="question-hyperlink">How to check whether the file exist in HDFS location, using oozie?</a>
</div>
		    
<div class="spacer js-gps-track" data-gps-track="linkedquestion.click({ source_post_id: 1401482, target_question_id: 11481115, position: 6 })">
	<a href="/q/11481115" title="Vote score (upvotes - downvotes)">
		<div class="answer-votes answered-accepted default">1</div>
	</a>
	<a href="/questions/11481115/bash-date-format-as-html5-datetime?noredirect=1" class="question-hyperlink">Bash: date format as HTML5 datetime</a>
</div>
		    
<div class="spacer js-gps-track" data-gps-track="linkedquestion.click({ source_post_id: 1401482, target_question_id: 21402722, position: 7 })">
	<a href="/q/21402722" title="Vote score (upvotes - downvotes)">
		<div class="answer-votes  default">0</div>
	</a>
	<a href="/questions/21402722/pentaho-data-integration-logging-backup?noredirect=1" class="question-hyperlink">Pentaho data integration logging backup</a>
</div>
		    
<div class="spacer js-gps-track" data-gps-track="linkedquestion.click({ source_post_id: 1401482, target_question_id: 17623681, position: 8 })">
	<a href="/q/17623681" title="Vote score (upvotes - downvotes)">
		<div class="answer-votes  default">2</div>
	</a>
	<a href="/questions/17623681/passing-a-date-to-a-ruby-function-as-stdin-in-bash?noredirect=1" class="question-hyperlink">Passing a date to a ruby function as STDIN in BASH</a>
</div>
		    
<div class="spacer js-gps-track" data-gps-track="linkedquestion.click({ source_post_id: 1401482, target_question_id: 42265158, position: 9 })">
	<a href="/q/42265158" title="Vote score (upvotes - downvotes)">
		<div class="answer-votes answered-accepted default">-2</div>
	</a>
	<a href="/questions/42265158/how-to-move-files-into-corresponding-folders-in-bash?noredirect=1" class="question-hyperlink">How to move files into corresponding folders in Bash</a>
</div>
		    <div class="spacer more ml32 pl16 pt8">
                <a href="/questions/linked/1401482">See more linked questions</a>
            </div>
	</div>
</div>


                    <div class="module sidebar-related">
                        <h4 id="h-related">Related</h4>
                        <div class="related js-gps-related-questions" data-tracker="rq=1">
                            <div class="spacer"><a href="/q/59838" title="Vote score (upvotes - downvotes)"><div class="answer-votes answered-accepted extra-large">3734</div></a><a href="/questions/59838/how-can-i-check-if-a-directory-exists-in-a-bash-shell-script" class="question-hyperlink">How can I check if a directory exists in a Bash shell script?</a></div><div class="spacer"><a href="/q/59895" title="Vote score (upvotes - downvotes)"><div class="answer-votes answered-accepted extra-large">4974</div></a><a href="/questions/59895/how-to-get-the-source-directory-of-a-bash-script-from-within-the-script-itself" class="question-hyperlink">How to get the source directory of a Bash script from within the script itself</a></div><div class="spacer"><a href="/q/89228" title="Vote score (upvotes - downvotes)"><div class="answer-votes answered-accepted extra-large">4900</div></a><a href="/questions/89228/calling-an-external-command-from-python" class="question-hyperlink">Calling an external command from Python</a></div><div class="spacer"><a href="/q/113045" title="Vote score (upvotes - downvotes)"><div class="answer-votes answered-accepted extra-large">1785</div></a><a href="/questions/113045/how-to-return-only-the-date-from-a-sql-server-datetime-datatype" class="question-hyperlink">How to return only the Date from a SQL Server DateTime datatype</a></div><div class="spacer"><a href="/q/221294" title="Vote score (upvotes - downvotes)"><div class="answer-votes answered-accepted extra-large">4027</div></a><a href="/questions/221294/how-do-you-get-a-timestamp-in-javascript" class="question-hyperlink">How do you get a timestamp in JavaScript?</a></div><div class="spacer"><a href="/q/226703" title="Vote score (upvotes - downvotes)"><div class="answer-votes answered-accepted extra-large">1452</div></a><a href="/questions/226703/how-do-i-prompt-for-yes-no-cancel-input-in-a-linux-shell-script" class="question-hyperlink">How do I prompt for Yes/No/Cancel input in a Linux shell script?</a></div><div class="spacer"><a href="/q/1531093" title="Vote score (upvotes - downvotes)"><div class="answer-votes answered-accepted extra-large">2322</div></a><a href="/questions/1531093/how-do-i-get-the-current-date-in-javascript" class="question-hyperlink">How do I get the current date in JavaScript?</a></div><div class="spacer"><a href="/q/3552461" title="Vote score (upvotes - downvotes)"><div class="answer-votes answered-accepted extra-large">2240</div></a><a href="/questions/3552461/how-to-format-a-javascript-date" class="question-hyperlink">How to format a JavaScript date</a></div><div class="spacer"><a href="/q/6482377" title="Vote score (upvotes - downvotes)"><div class="answer-votes answered-accepted extra-large">1350</div></a><a href="/questions/6482377/check-existence-of-input-argument-in-a-bash-shell-script" class="question-hyperlink">Check existence of input argument in a Bash shell script</a></div><div class="spacer"><a href="/q/8467424" title="Vote score (upvotes - downvotes)"><div class="answer-votes answered-accepted extra-large">2389</div></a><a href="/questions/8467424/echo-newline-in-bash-prints-literal-n" class="question-hyperlink">Echo newline in Bash prints literal \n</a></div>
                        </div>
                    </div>

                <div id="hot-network-questions" class="module tex2jax_ignore">
    <h4>
        <a href="https://stackexchange.com/questions?tab=hot"
           class="js-gps-track s-link s-link__inherit" 
           data-gps-track="posts_hot_network.click({ item_type:1, location:11 })">
            Hot Network Questions
        </a>
    </h4>
    <ul>
            <li >
                <div class="favicon favicon-interpersonal" title="Interpersonal Skills Stack Exchange"></div><a href="https://interpersonal.stackexchange.com/questions/25758/how-do-i-support-a-friend-on-social-media-who-contacted-me-directly-about-someth" class="js-gps-track question-hyperlink mb0" data-gps-track="site.switch({ item_type:11, target_site:680 }); posts_hot_network.click({ item_type:2, location:11 })">
                    How do I support a friend on Social Media who contacted me directly about something I don&#x27;t want to be involved in?
                </a>

            </li>
            <li >
                <div class="favicon favicon-space" title="Space Exploration Stack Exchange"></div><a href="https://space.stackexchange.com/questions/44877/what-were-the-first-soviet-spacecraft-to-use-an-internal-docking-tunnel" class="js-gps-track question-hyperlink mb0" data-gps-track="site.switch({ item_type:11, target_site:508 }); posts_hot_network.click({ item_type:2, location:11 })">
                    What were the first Soviet spacecraft to use an internal docking tunnel?
                </a>

            </li>
            <li >
                <div class="favicon favicon-quant" title="Quantitative Finance Stack Exchange"></div><a href="https://quant.stackexchange.com/questions/55037/application-of-itos-lemma-in-expected-utility-theory" class="js-gps-track question-hyperlink mb0" data-gps-track="site.switch({ item_type:11, target_site:204 }); posts_hot_network.click({ item_type:2, location:11 })">
                    Application of Ito&#x27;s Lemma in expected utility theory
                </a>

            </li>
            <li >
                <div class="favicon favicon-gamedev" title="Game Development Stack Exchange"></div><a href="https://gamedev.stackexchange.com/questions/183655/switch-statement-efficiency-in-game-code" class="js-gps-track question-hyperlink mb0" data-gps-track="site.switch({ item_type:11, target_site:53 }); posts_hot_network.click({ item_type:2, location:11 })">
                    Switch statement efficiency in game code
                </a>

            </li>
            <li >
                <div class="favicon favicon-security" title="Information Security Stack Exchange"></div><a href="https://security.stackexchange.com/questions/233465/strongest-file-encryption-available" class="js-gps-track question-hyperlink mb0" data-gps-track="site.switch({ item_type:11, target_site:162 }); posts_hot_network.click({ item_type:2, location:11 })">
                    Strongest File Encryption available
                </a>

            </li>
            <li class="dno js-hidden">
                <div class="favicon favicon-cooking" title="Seasoned Advice"></div><a href="https://cooking.stackexchange.com/questions/109138/why-are-quiches-baked-in-fluted-tins" class="js-gps-track question-hyperlink mb0" data-gps-track="site.switch({ item_type:11, target_site:49 }); posts_hot_network.click({ item_type:2, location:11 })">
                    Why are quiches baked in fluted tins?
                </a>

            </li>
            <li class="dno js-hidden">
                <div class="favicon favicon-aviation" title="Aviation Stack Exchange"></div><a href="https://aviation.stackexchange.com/questions/78949/is-it-possible-to-fly-an-easa-registered-airplane-with-an-icao-license" class="js-gps-track question-hyperlink mb0" data-gps-track="site.switch({ item_type:11, target_site:528 }); posts_hot_network.click({ item_type:2, location:11 })">
                    Is it possible to fly an EASA registered airplane with an ICAO license?
                </a>

            </li>
            <li class="dno js-hidden">
                <div class="favicon favicon-apple" title="Ask Different"></div><a href="https://apple.stackexchange.com/questions/394064/does-apple-make-backups-of-icloud" class="js-gps-track question-hyperlink mb0" data-gps-track="site.switch({ item_type:11, target_site:118 }); posts_hot_network.click({ item_type:2, location:11 })">
                    Does Apple make backups of iCloud?
                </a>

            </li>
            <li class="dno js-hidden">
                <div class="favicon favicon-retrocomputing" title="Retrocomputing Stack Exchange"></div><a href="https://retrocomputing.stackexchange.com/questions/15242/which-is-the-minimum-set-of-interrupts-functions-i-should-implement-in-a-replace" class="js-gps-track question-hyperlink mb0" data-gps-track="site.switch({ item_type:11, target_site:648 }); posts_hot_network.click({ item_type:2, location:11 })">
                    Which is the minimum set of interrupts/functions I should implement in a replacement BIOS for a home made IBM PC class computer?
                </a>

            </li>
            <li class="dno js-hidden">
                <div class="favicon favicon-unix" title="Unix &amp; Linux Stack Exchange"></div><a href="https://unix.stackexchange.com/questions/593758/filter-lines-based-on-set-of-words-in-specific-column" class="js-gps-track question-hyperlink mb0" data-gps-track="site.switch({ item_type:11, target_site:106 }); posts_hot_network.click({ item_type:2, location:11 })">
                    filter lines based on set of words in specific column
                </a>

            </li>
            <li class="dno js-hidden">
                <div class="favicon favicon-politics" title="Politics Stack Exchange"></div><a href="https://politics.stackexchange.com/questions/54043/is-there-a-double-standard-in-the-scotus-june-2020-ruling-on-daca" class="js-gps-track question-hyperlink mb0" data-gps-track="site.switch({ item_type:11, target_site:475 }); posts_hot_network.click({ item_type:2, location:11 })">
                    Is there a &quot;double-standard&quot; in the SCOTUS June 2020 ruling on DACA?
                </a>

            </li>
            <li class="dno js-hidden">
                <div class="favicon favicon-ell" title="English Language Learners Stack Exchange"></div><a href="https://ell.stackexchange.com/questions/251253/whats-the-meaning-of-boidmachine" class="js-gps-track question-hyperlink mb0" data-gps-track="site.switch({ item_type:11, target_site:481 }); posts_hot_network.click({ item_type:2, location:11 })">
                    What&#x27;s the meaning of &quot;Boidmachine&quot;?
                </a>

            </li>
            <li class="dno js-hidden">
                <div class="favicon favicon-scifi" title="Science Fiction &amp; Fantasy Stack Exchange"></div><a href="https://scifi.stackexchange.com/questions/232874/when-did-the-idea-of-coruscant-being-a-planet-wide-city-develop" class="js-gps-track question-hyperlink mb0" data-gps-track="site.switch({ item_type:11, target_site:186 }); posts_hot_network.click({ item_type:2, location:11 })">
                    When did the idea of Coruscant being a planet wide city develop?
                </a>

            </li>
            <li class="dno js-hidden">
                <div class="favicon favicon-worldbuilding" title="Worldbuilding Stack Exchange"></div><a href="https://worldbuilding.stackexchange.com/questions/178892/can-the-little-princes-planet-actually-exist-in-our-universe" class="js-gps-track question-hyperlink mb0" data-gps-track="site.switch({ item_type:11, target_site:579 }); posts_hot_network.click({ item_type:2, location:11 })">
                    Can the Little Prince&#x27;s planet actually exist in our universe?
                </a>

            </li>
            <li class="dno js-hidden">
                <div class="favicon favicon-linguistics" title="Linguistics Stack Exchange"></div><a href="https://linguistics.stackexchange.com/questions/36550/a-question-about-optimality-theory" class="js-gps-track question-hyperlink mb0" data-gps-track="site.switch({ item_type:11, target_site:312 }); posts_hot_network.click({ item_type:2, location:11 })">
                    A question about Optimality Theory
                </a>

            </li>
            <li class="dno js-hidden">
                <div class="favicon favicon-politics" title="Politics Stack Exchange"></div><a href="https://politics.stackexchange.com/questions/54035/did-hillary-clinton-win-the-popular-vote-by-2-09-or-2-22-percentage-points" class="js-gps-track question-hyperlink mb0" data-gps-track="site.switch({ item_type:11, target_site:475 }); posts_hot_network.click({ item_type:2, location:11 })">
                    Did Hillary Clinton win the popular vote by 2.09 or 2.22 percentage points?
                </a>

            </li>
            <li class="dno js-hidden">
                <div class="favicon favicon-hermeneutics" title="Biblical Hermeneutics Stack Exchange"></div><a href="https://hermeneutics.stackexchange.com/questions/48556/1-corinthians-125-who-is-god" class="js-gps-track question-hyperlink mb0" data-gps-track="site.switch({ item_type:11, target_site:320 }); posts_hot_network.click({ item_type:2, location:11 })">
                    1 Corinthians 1:25, who is God?
                </a>

            </li>
            <li class="dno js-hidden">
                <div class="favicon favicon-physics" title="Physics Stack Exchange"></div><a href="https://physics.stackexchange.com/questions/559744/why-cant-many-models-be-solved-exactly" class="js-gps-track question-hyperlink mb0" data-gps-track="site.switch({ item_type:11, target_site:151 }); posts_hot_network.click({ item_type:2, location:11 })">
                    Why can&#x27;t many models be solved exactly?
                </a>

            </li>
            <li class="dno js-hidden">
                <div class="favicon favicon-scifi" title="Science Fiction &amp; Fantasy Stack Exchange"></div><a href="https://scifi.stackexchange.com/questions/233023/which-technologies-depicted-in-the-various-star-trek-series-over-the-past-few-de" class="js-gps-track question-hyperlink mb0" data-gps-track="site.switch({ item_type:11, target_site:186 }); posts_hot_network.click({ item_type:2, location:11 })">
                    Which technologies depicted in the various Star Trek series over the past few decades have been realized to-date?
                </a>

            </li>
            <li class="dno js-hidden">
                <div class="favicon favicon-blender" title="Blender Stack Exchange"></div><a href="https://blender.stackexchange.com/questions/183254/why-cant-i-change-delete-the-world-background-image" class="js-gps-track question-hyperlink mb0" data-gps-track="site.switch({ item_type:11, target_site:502 }); posts_hot_network.click({ item_type:2, location:11 })">
                    Why can&#x27;t I change/delete the world background image?
                </a>

            </li>
            <li class="dno js-hidden">
                <div class="favicon favicon-boardgames" title="Board &amp; Card Games Stack Exchange"></div><a href="https://boardgames.stackexchange.com/questions/51478/what-happens-if-a-permanent-is-made-to-gain-and-then-lose-an-ability-or-vice-ve" class="js-gps-track question-hyperlink mb0" data-gps-track="site.switch({ item_type:11, target_site:147 }); posts_hot_network.click({ item_type:2, location:11 })">
                    What happens if a permanent is made to gain and then lose an ability, or vice versa?
                </a>

            </li>
            <li class="dno js-hidden">
                <div class="favicon favicon-puzzling" title="Puzzling Stack Exchange"></div><a href="https://puzzling.stackexchange.com/questions/99190/me-i-cause-pain" class="js-gps-track question-hyperlink mb0" data-gps-track="site.switch({ item_type:11, target_site:559 }); posts_hot_network.click({ item_type:2, location:11 })">
                    Me? I cause pain
                </a>

            </li>
            <li class="dno js-hidden">
                <div class="favicon favicon-academia" title="Academia Stack Exchange"></div><a href="https://academia.stackexchange.com/questions/150600/colleague-blames-me-for-not-spotting-typos-when-i-only-reviewed-the-structure-an" class="js-gps-track question-hyperlink mb0" data-gps-track="site.switch({ item_type:11, target_site:415 }); posts_hot_network.click({ item_type:2, location:11 })">
                    Colleague blames me for not spotting typos when I only reviewed the structure and content
                </a>

            </li>
            <li class="dno js-hidden">
                <div class="favicon favicon-physics" title="Physics Stack Exchange"></div><a href="https://physics.stackexchange.com/questions/560294/is-it-possible-to-make-the-sun-spin-a-coin-in-space" class="js-gps-track question-hyperlink mb0" data-gps-track="site.switch({ item_type:11, target_site:151 }); posts_hot_network.click({ item_type:2, location:11 })">
                    Is it possible to make the Sun spin a coin in space?
                </a>

            </li>
    </ul>

        <a href="#" 
           class="show-more js-show-more js-gps-track" 
           data-gps-track="posts_hot_network.click({ item_type:3, location:11 })">
            more hot questions
        </a>
</div>

                            <div id="feed-link" class="js-feed-link">
        <a href="/feeds/question/1401482" title="Feed of this question and its answers">
            <svg aria-hidden="true" class="fc-orange-400 svg-icon iconRss" width="18" height="18" viewBox="0 0 18 18"><path d="M1 3c0-1.1.9-2 2-2h12a2 2 0 012 2v12a2 2 0 01-2 2H3a2 2 0 01-2-2V3zm14.5 12C15.5 8.1 9.9 2.5 3 2.5V5a10 10 0 0110 10h2.5zm-5 0A7.5 7.5 0 003 7.5V10a5 5 0 015 5h2.5zm-5 0A2.5 2.5 0 003 12.5V15h2.5z"/></svg>
            Question feed
        </a>
    </div>
    <aside class="s-modal js-feed-link-modal" tabindex="-1" role="dialog" aria-labelledby="feed-modal-title" aria-describedby="feed-modal-description" aria-hidden="true">
        <div class="s-modal--dialog js-modal-dialog wmx4" role="document"  data-controller="se-draggable">
            <h1 class="s-modal--header fw-bold js-first-tabbable" id="feed-modal-title" data-target="se-draggable.handle" tabindex="0">
                Subscribe to RSS
            </h1>
            <div class="grid gs4 gsy fd-column">
                <div class="grid--cell">
                    <label class="d-block s-label c-default" for="feed-url">
                        Question feed
                        <p class="s-description mt2" id="feed-modal-description">To subscribe to this RSS feed, copy and paste this URL into your RSS reader.</p>
                    </label>
                </div>
                <div class="grid ps-relative">
                    <input class="s-input" type="text" name="feed-url" id="feed-url" readonly="readonly" value="https://stackoverflow.com/feeds/question/1401482" />
                    <svg aria-hidden="true" class="s-input-icon fc-orange-400 svg-icon iconRss" width="18" height="18" viewBox="0 0 18 18"><path d="M1 3c0-1.1.9-2 2-2h12a2 2 0 012 2v12a2 2 0 01-2 2H3a2 2 0 01-2-2V3zm14.5 12C15.5 8.1 9.9 2.5 3 2.5V5a10 10 0 0110 10h2.5zm-5 0A7.5 7.5 0 003 7.5V10a5 5 0 015 5h2.5zm-5 0A2.5 2.5 0 003 12.5V15h2.5z"/></svg>
                </div>
            </div>
            <a class="s-modal--close s-btn s-btn__muted js-modal-close js-last-tabbable" href="#" aria-label="Close">
                <svg aria-hidden="true" class="svg-icon iconClearSm" width="14" height="14" viewBox="0 0 14 14"><path d="M12 3.41L10.59 2 7 5.59 3.41 2 2 3.41 5.59 7 2 10.59 3.41 12 7 8.41 10.59 12 12 10.59 8.41 7 12 3.41z"/></svg>
            </a>
        </div>
    </aside>

            </div>
    </div>
<script>StackExchange.ready(function(){$.get('/posts/1401482/ivc/cf7b');});</script>
<noscript><div><img src="/posts/1401482/ivc/cf7b" class="dno" alt="" width="0" height="0"></div></noscript><div style="display:none" id="prettify-lang">lang-sh</div></div>


        </div>
    </div>
        
<script>;try{(function(a){function b(a){return'string'==typeof a?document.getElementById(a):a}function c(a){return a=b(a),!!a&&'none'===getComputedStyle(a).display}function d(a){return!c(a)}function e(a){return!!a}function f(a){return /^\s*$/.test(b(a).innerHTML)}function g(a){var b=a.style;b.height=b.maxHeight=b.minHeight='auto',b.display='none',[].forEach.call(a.children,g)}function h(a,b){var c;return function(){return a&&(c=a.call(b||this,arguments),a=null),c}}function i(a){var b=document.createElement('script');b.src=a,document.body.appendChild(b)}function j(a){return k([],a)}function k(a,b){return a.push=function(a){return b(),delete this.push,this.push(a)},a}function l(){try{return!new Function('return async()=>{};')}catch(a){return!0}}function m(){return'undefined'!=typeof googletag&&!!googletag.apiReady}function n(){m()||(googletag={cmd:j(A)})}function o(){var a=document.createElement('div');a.className='adsbox',a.id='clc-abd',a.style.position='absolute',a.style.pointerEvents='none',a.innerHTML='&nbsp;',document.body.appendChild(a)}function p(){return Object.keys(E.ids)}function r(a){var b=E.ids[a],c=E.slots[b];'function'==typeof c&&(c=c(a));return{path:'/'+B+'/'+D+'/'+b+'/'+C,sizes:c,zone:b}}function q(a){try{Array.isArray(clc.dfp.slotsRenderedEvents)||(clc.dfp.slotsRenderedEvents=[]),clc.dfp.slotsRenderedEvents.push(a);var b=a.slot.getSlotElementId(),c=[];b||c.push('id=0');var d=document.getElementById(b);if(!b||d?d.hasAttribute('data-clc-stalled')&&c.push('st=1'):c.push('el=0'),0!==c.length)return void F(c.join('&'));var e=r(b),f=e.zone;if(clc.collapse&&clc.collapse[f]&&a.isEmpty)return g(d),void d.setAttribute('data-clc-ready','true');if(-1!==x.dh.indexOf(a.lineItemId))g(d);else if(a.lineItemId&&(d.setAttribute('data-clc-prefilled','true'),'dfp-msb'==b)){var h=document.getElementById('hireme');g(h)}d.setAttribute('data-clc-ready','true')}catch(a){var i=document.querySelector('#dfp-tsb, #dfp-isb, #clc-tsb');i&&i.setAttribute('data-clc-ready','true'),F('e=1')}}function s(a){return!(clc.collapse&&void 0!==clc.collapse[a])||!!clc.collapse[a]}function t(a,b){'dfp-isb'===a&&b.setTargeting('Sidebar',['Inline']),'dfp-tsb'===a&&b.setTargeting('Sidebar',['Right']);var c=r(a),d=c.path,e=c.sizes,f=c.zone,g=googletag.defineSlot(d,e,a);if(s(f)){var h=!x.ll;g.setCollapseEmptyDiv(!0,h)}g.addService(b),!1}function u(b){var c=a.dfp&&a.dfp.targeting||{};'SystemDefault'===c.ProductVariant&&(window.matchMedia&&window.matchMedia('(prefers-color-scheme: dark)').matches?c.ProductVariant='Dark':c.ProductVariant='Light'),Object.keys(c).forEach(function(a){b.setTargeting(a,c[a])})}function v(a){var g=a.map(b).filter(e);return{eligible:g.filter(f).filter(d),ineligible:g.filter(c)}}function w(b){void 0===b&&(b=p());var c=['dfp-mlb','dfp-smlb'];if(!m())return n(),void googletag.cmd.push(function(){return w(b)});var d=v(b),e=d.eligible,f=d.ineligible;if(f.forEach(g),0!==e.length){x.abd&&o(),googletag.destroySlots();var h=googletag.pubads();x.sf&&(h.setForceSafeFrame(!0),h.setSafeFrameConfig({allowOverlayExpansion:!0,allowPushExpansion:!0,sandbox:!0})),x.ll||h.enableSingleRequest(),a.sreEvent||(h.addEventListener('slotRenderEnded',q),a.sreEvent=!0),u(h);var i=e.filter(function(a){return!x.ll||0>c.indexOf(a.id)}),j=e.filter(function(a){return!!x.ll&&0<=c.indexOf(a.id)});i.forEach(function(a){t(a.id,h),a.setAttribute('data-dfp-zone','true')}),googletag.enableServices(),i.forEach(function(a){googletag.display(a.id)}),x.ll&&(h.enableLazyLoad({fetchMarginPercent:0,renderMarginPercent:0}),j.forEach(function(a){t(a.id,h),a.setAttribute('data-clc-prefilled','true')}),j.forEach(function(a){googletag.display(a.id)}))}}var x=function(a){for(var b=[],c=1;c<arguments.length;c++)b[c-1]=arguments[c];for(var d,e=0,f=b;e<f.length;e++)for(var g in d=f[e],d)a[g]=d[g];return a}({"lib":"https://cdn.sstatic.net/clc/clc.min.js?v=7dce99576e19","style":"https://cdn.sstatic.net/clc/styles/clc.min.css?v=ac5522400b2d","u":"https://clc.stackoverflow.com/markup.js","wa":true,"kt":2000,"tto":true,"h":"clc.stackoverflow.com","allowed":"^(((talent\\.)?stackoverflow)|(blog\\.codinghorror)|(serverfault|askubuntu)|([^\\.]+\\.stackexchange))\\.com$","wv":true,"al":false,"dh":[5171832659],"abd":true},a.options||{}),y=h(function(){var a=x.lib;l()&&(a=a.replace(/(\.min)?\.js(\?v=[0-9a-fA-F]+)?$/,'.ie$1.js$2')),i(a)}),z=a.cmd||[];Array.isArray(z)&&(0<z.length?y():k(z,y));var A=h(function(){i('https://www.googletagservices.com/tag/js/gpt.js')}),B='248424177',C=/^\/tags\//.test(location.pathname)||/^\/questions\/tagged\//.test(location.pathname)?'tag-pages':/^\/$/.test(location.pathname)||/^\/home/.test(location.pathname)?'home-page':'question-pages',D=location.hostname;var E={slots:{lb:[[728,90]],mlb:[[728,90]],smlb:[[728,90]],bmlb:[[728,90]],sb:function(a){return'dfp-tsb'===a?[[300,250],[300,600]]:[[300,250]]},"tag-sponsorship":[[730,135]],"mobile-below-question":[[320,50],[300,250]],msb:[[300,250],[300,600]]},ids:{"dfp-tlb":'lb',"dfp-mlb":'mlb',"dfp-smlb":'smlb',"dfp-bmlb":'bmlb',"dfp-tsb":'sb',"dfp-isb":'sb',"dfp-tag":'tag-sponsorship',"dfp-msb":'msb',"dfp-m-aq":'mobile-below-question',"clc-tlb":'lb',"clc-mlb":'mlb',"clc-tsb":'sb'}},F=function(a){new Image().src='https://'+x.h+'/stalled.gif?'+a};(function(){var b=x.al;b&&z.push(function(){return a.load()})})(),n(),a.dfp={load:w},a.options=x,a.cmd=z})(this.clc=this.clc||{})}catch(a){window.console.error(a)}</script>    <script>
        var clc = clc || {};
        clc.collapse = { sb: !0, 'tag-sponsorship': !0, lb:!0, mlb:!0, smlb:!0, bmlb:!0, 'mobile-below-question':!0};
        clc.options = clc.options || {};
        clc.options.sf = !0;
        clc.options.hb = !1;
        clc.options.ll = !0;
        clc.cmd = clc.cmd || [];
        clc.cmd.push(function () { window.clc_request='AkGV19l3FNgIAAAAAIpiFQACAAAAAgAAAAAaAAAAfGJhc2h8c2hlbGx8ZGF0ZXxzdHJmdGltZXwAk3BJGOo_Q9wncQ'; clc.load(); });
        clc.dfp = clc.dfp || {};
        clc.dfp.targeting = {Registered:['false'],'so-tag':['bash','shell','date','strftime'],'tag-reportable':['bash','shell','date','strftime'],'tag-non-reportable':['bash','shell','date','strftime'],NumberOfAnswers:['13']};
        var googletag = googletag || {};
        googletag.cmd = googletag.cmd || [];
        googletag.cmd.push(function () { clc.dfp.load(); });

    </script>

            <footer id="footer" class="site-footer js-footer" role="contentinfo">
        <div class="site-footer--container">
                <div class="site-footer--logo">
                    
                    <a href="https://stackoverflow.com"><svg aria-hidden="true" class="native svg-icon iconLogoGlyphMd" width="32" height="37" viewBox="0 0 32 37"><path d="M26 33v-9h4v13H0V24h4v9h22z" fill="#BCBBBB"/><path d="M21.5 0l-2.7 2 9.9 13.3 2.7-2L21.5 0zM26 18.4L13.3 7.8l2.1-2.5 12.7 10.6-2.1 2.5zM9.1 15.2l15 7 1.4-3-15-7-1.4 3zm14 10.79l.68-2.95-16.1-3.35L7 23l16.1 2.99zM23 30H7v-3h16v3z" fill="#F48024"/></svg></a>
                </div>
            <nav class="site-footer--nav">
                    <div class="site-footer--col site-footer--col__visible js-footer-col" data-name="default">
                        <h5 class="-title"><a href="https://stackoverflow.com" class="js-gps-track" data-gps-track="footer.click({ location: 2, link: 15})">Stack Overflow</a></h5>
                        <ul class="-list js-primary-footer-links">
                            <li class="-item"><a href="/questions" class="js-gps-track -link" data-gps-track="footer.click({ location: 2, link: 16})">Questions</a></li>
                                <li class="-item"><a href="https://stackoverflow.com/jobs" class="js-gps-track -link" data-gps-track="footer.click({ location: 2, link: 17})">Jobs</a></li>
                                <li class="-item"><a href="https://stackoverflow.com/jobs/directory/developer-jobs" class="js-gps-track -link" data-gps-track="footer.click({ location: 2, link: 11})">Developer Jobs Directory</a></li>
                                     <li class="-item"><a href="https://stackoverflow.com/jobs/salary" class="js-gps-track -link" data-gps-track="footer.click({ location: 2, link: 28})">Salary Calculator</a></li>
                                <li class="-item"><a href="/help" class="js-gps-track -link" data-gps-track="footer.click({ location: 2, link: 3 })">Help</a></li>
                                <li class="-item"><a onclick='StackExchange.switchMobile("on")' class="js-gps-track -link" data-gps-track="footer.click({ location: 2, link: 12 })">Mobile</a></li>
                        </ul>
                    </div>
                    <div class="site-footer--col site-footer--col__visible js-footer-col" data-name="default">
                        <h5 class="-title"><a href="https://stackoverflowbusiness.com" class="js-gps-track" data-gps-track="footer.click({ location: 2, link: 19 })">Products</a></h5>
                        <ul class="-list">
                            <li class="-item"><a href="https://stackoverflow.com/teams" class="js-gps-track -link" 
                                                 data-ga="[&quot;teams traffic&quot;,&quot;footer - site nav&quot;,&quot;stackoverflow.com/teams&quot;,null,{&quot;dimension4&quot;:&quot;teams&quot;}]"
                                                 data-gps-track="footer.click({ location: 2, link: 29 })">Teams</a></li>
                            <li class="-item"><a href="https://stackoverflow.com/talent" class="js-gps-track -link" data-gps-track="footer.click({ location: 2, link: 20 })">Talent</a></li>
                            <li class="-item"><a href="https://stackoverflow.com/advertising" class="js-gps-track -link" data-gps-track="footer.click({ location: 2, link: 21 })">Advertising</a></li>
                            <li class="-item"><a href="https://stackoverflow.com/enterprise" class="js-gps-track -link" data-gps-track="footer.click({ location: 2, link: 22 })">Enterprise</a></li>
                        </ul>
                    </div>
                <div class="site-footer--col site-footer--col__visible js-footer-col" data-name="default">
                    <h5 class="-title"><a class="js-gps-track" data-gps-track="footer.click({ location: 2, link: 1 })" href="https://stackoverflow.com/company/about">Company</a></h5>
                    <ul class="-list">
                            <li class="-item"><a class="js-gps-track -link" data-gps-track="footer.click({ location: 2, link: 1 })" href="https://stackoverflow.com/company/about">About</a></li>
                        <li class="-item"><a class="js-gps-track -link" data-gps-track="footer.click({ location: 2, link: 27 })" href="https://stackoverflow.com/company/press">Press</a></li>
                            <li class="-item"><a class="js-gps-track -link" data-gps-track="footer.click({ location: 2, link: 9 })" href="https://stackoverflow.com/company/work-here">Work Here</a></li>
                        <li class="-item"><a class="js-gps-track -link" data-gps-track="footer.click({ location: 2, link: 7 })" href="https://stackoverflow.com/legal">Legal</a></li>
                        <li class="-item"><a class="js-gps-track -link" data-gps-track="footer.click({ location: 2, link: 8 })" href="https://stackoverflow.com/legal/privacy-policy">Privacy Policy</a></li>
                            <li class="-item"><a class="js-gps-track -link" data-gps-track="footer.click({ location: 2, link: 13 })" href="https://stackoverflow.com/company/contact">Contact Us</a></li>
                    </ul>
                </div>
                <div class="site-footer--col site-footer--categories-nav site-footer--col__visible">
                    <a href="#" class="site-footer--back js-footer-back"><svg aria-hidden="true" class="svg-icon iconArrowLeftAlt" width="18" height="18" viewBox="0 0 18 18"><path d="M10.58 16L12 14.59 6.4 9 12 3.41 10.57 2l-7 7 7 7z"/></svg></a>
                    <div>
                        <h5 class="-title"><a href="https://stackexchange.com" data-gps-track="footer.click({ location: 2, link: 30 })">Stack Exchange<br> Network</a></h5>
                        <ul class="-list">
                            <li class="-item"><a href="#" class="-link _expandable js-footer-category-trigger js-gps-track" data-gps-track="footer.click({ location: 2, link: 24 })" data-target="Technology">Technology</a></li>
                            <li class="-item"><a href="#" class="-link _expandable js-footer-category-trigger js-gps-track" data-gps-track="footer.click({ location: 2, link: 24 })" data-target="Life / Arts">Life / Arts</a></li>
                            <li class="-item"><a href="#" class="-link _expandable js-footer-category-trigger js-gps-track" data-gps-track="footer.click({ location: 2, link: 24 })" data-target="Culture / Recreation">Culture / Recreation</a></li>
                            <li class="-item"><a href="#" class="-link _expandable js-footer-category-trigger js-gps-track" data-gps-track="footer.click({ location: 2, link: 24 })" data-target="Science">Science</a></li>
                            <li class="-item"><a href="#" class="-link _expandable js-footer-category-trigger js-gps-track" data-gps-track="footer.click({ location: 2, link: 24 })" data-target="Other">Other</a></li>
                        </ul>
                    </div>
                </div>
                <div class="site-footer--categories">
                        <div class="site-footer--col site-footer--category js-footer-col" data-name="Technology">
        <ul class="-list">
                <li class="-item"><a href="https://stackoverflow.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="professional and enthusiast programmers">Stack Overflow</a></li>
                <li class="-item"><a href="https://serverfault.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="system and network administrators">Server Fault</a></li>
                <li class="-item"><a href="https://superuser.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="computer enthusiasts and power users">Super User</a></li>
                <li class="-item"><a href="https://webapps.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="power users of web applications">Web Applications</a></li>
                <li class="-item"><a href="https://askubuntu.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="Ubuntu users and developers">Ask Ubuntu</a></li>
                <li class="-item"><a href="https://webmasters.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="pro webmasters">Webmasters</a></li>
                <li class="-item"><a href="https://gamedev.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="professional and independent game developers">Game Development</a></li>
                    </ul></div><div class="site-footer--col site-footer--category js-footer-col" data-name="Technology"><ul class="-list">
                <li class="-item"><a href="https://tex.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="users of TeX, LaTeX, ConTeXt, and related typesetting systems">TeX - LaTeX</a></li>
                <li class="-item"><a href="https://softwareengineering.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="professionals, academics, and students working within the systems development life cycle">Software Engineering</a></li>
                <li class="-item"><a href="https://unix.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="users of Linux, FreeBSD and other Un*x-like operating systems">Unix &amp; Linux</a></li>
                <li class="-item"><a href="https://apple.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="power users of Apple hardware and software">Ask Different (Apple)</a></li>
                <li class="-item"><a href="https://wordpress.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="WordPress developers and administrators">WordPress Development</a></li>
                <li class="-item"><a href="https://gis.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="cartographers, geographers and GIS professionals">Geographic Information Systems</a></li>
                <li class="-item"><a href="https://electronics.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="electronics and electrical engineering professionals, students, and enthusiasts">Electrical Engineering</a></li>
                    </ul></div><div class="site-footer--col site-footer--category js-footer-col" data-name="Technology"><ul class="-list">
                <li class="-item"><a href="https://android.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="enthusiasts and power users of the Android operating system">Android Enthusiasts</a></li>
                <li class="-item"><a href="https://security.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="information security professionals">Information Security</a></li>
                <li class="-item"><a href="https://dba.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="database professionals who wish to improve their database skills and learn from others in the community">Database Administrators</a></li>
                <li class="-item"><a href="https://drupal.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="Drupal developers and administrators">Drupal Answers</a></li>
                <li class="-item"><a href="https://sharepoint.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="SharePoint enthusiasts">SharePoint</a></li>
                <li class="-item"><a href="https://ux.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="user experience researchers and experts">User Experience</a></li>
                <li class="-item"><a href="https://mathematica.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="users of Wolfram Mathematica">Mathematica</a></li>
                    </ul></div><div class="site-footer--col site-footer--category js-footer-col" data-name="Technology"><ul class="-list">
                <li class="-item"><a href="https://salesforce.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="Salesforce administrators, implementation experts, developers and anybody in-between">Salesforce</a></li>
                <li class="-item"><a href="https://expressionengine.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="administrators, end users, developers and designers for ExpressionEngine&#xAE; CMS">ExpressionEngine&#xAE; Answers</a></li>
                <li class="-item"><a href="https://pt.stackoverflow.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="programadores profissionais e entusiastas">Stack Overflow em Portugu&#xEA;s</a></li>
                <li class="-item"><a href="https://blender.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="people who use Blender to create 3D graphics, animations, or games">Blender</a></li>
                <li class="-item"><a href="https://networkengineering.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="network engineers">Network Engineering</a></li>
                <li class="-item"><a href="https://crypto.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="software developers, mathematicians and others interested in cryptography">Cryptography</a></li>
                <li class="-item"><a href="https://codereview.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="peer programmer code reviews">Code Review</a></li>
                    </ul></div><div class="site-footer--col site-footer--category js-footer-col" data-name="Technology"><ul class="-list">
                <li class="-item"><a href="https://magento.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="users of the Magento e-Commerce platform">Magento</a></li>
                <li class="-item"><a href="https://softwarerecs.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="people seeking specific software recommendations">Software Recommendations</a></li>
                <li class="-item"><a href="https://dsp.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="practitioners of the art and science of signal, image and video processing">Signal Processing</a></li>
                <li class="-item"><a href="https://emacs.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="those using, extending or developing Emacs">Emacs</a></li>
                <li class="-item"><a href="https://raspberrypi.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="users and developers of hardware and software for Raspberry Pi">Raspberry Pi</a></li>
                <li class="-item"><a href="https://ru.stackoverflow.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="&#x43F;&#x440;&#x43E;&#x433;&#x440;&#x430;&#x43C;&#x43C;&#x438;&#x441;&#x442;&#x43E;&#x432;">Stack Overflow &#x43D;&#x430; &#x440;&#x443;&#x441;&#x441;&#x43A;&#x43E;&#x43C;</a></li>
                <li class="-item"><a href="https://codegolf.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="programming puzzle enthusiasts and code golfers">Code Golf</a></li>
                    </ul></div><div class="site-footer--col site-footer--category js-footer-col" data-name="Technology"><ul class="-list">
                <li class="-item"><a href="https://es.stackoverflow.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="programadores y profesionales de la inform&#xE1;tica">Stack Overflow en espa&#xF1;ol</a></li>
                <li class="-item"><a href="https://ethereum.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="users of Ethereum, the decentralized application platform and smart contract enabled blockchain">Ethereum</a></li>
                <li class="-item"><a href="https://datascience.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="Data science professionals, Machine Learning specialists, and those interested in learning more about the field">Data Science</a></li>
                <li class="-item"><a href="https://arduino.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="developers of open-source hardware and software that is compatible with Arduino">Arduino</a></li>
                <li class="-item"><a href="https://bitcoin.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="Bitcoin crypto-currency enthusiasts">Bitcoin</a></li>
                <li class="-item"><a href="https://sqa.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="software quality control experts, automation engineers, and software testers">Software Quality Assurance &amp; Testing</a></li>
                <li class="-item"><a href="https://sound.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="sound engineers, producers, editors, and enthusiasts">Sound Design</a></li>
                    </ul></div><div class="site-footer--col site-footer--category js-footer-col" data-name="Technology"><ul class="-list">
                <li class="-item"><a href="https://windowsphone.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="enthusiasts and power users of Windows Phone OS">Windows Phone</a></li>
                <li class="-item">
                    <a href="https://stackexchange.com/sites#technology" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 26 })">
                        <strong>
                            more (28)
                        </strong>
                    </a>
                </li>
        </ul>
    </div>
    <div class="site-footer--col site-footer--category js-footer-col" data-name="Life / Arts">
        <ul class="-list">
                <li class="-item"><a href="https://photo.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="professional, enthusiast and amateur photographers">Photography</a></li>
                <li class="-item"><a href="https://scifi.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="science fiction and fantasy enthusiasts">Science Fiction &amp; Fantasy</a></li>
                <li class="-item"><a href="https://graphicdesign.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="Graphic Design professionals, students, and enthusiasts">Graphic Design</a></li>
                <li class="-item"><a href="https://movies.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="movie and TV enthusiasts">Movies &amp; TV</a></li>
                <li class="-item"><a href="https://music.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="musicians, students, and enthusiasts">Music: Practice &amp; Theory</a></li>
                <li class="-item"><a href="https://worldbuilding.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="writers/artists using science, geography and culture to construct imaginary worlds and settings">Worldbuilding</a></li>
                <li class="-item"><a href="https://video.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="engineers, producers, editors, and enthusiasts spanning the fields of video, and media creation">Video Production</a></li>
                    </ul></div><div class="site-footer--col site-footer--category js-footer-col" data-name="Life / Arts"><ul class="-list">
                <li class="-item"><a href="https://cooking.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="professional and amateur chefs">Seasoned Advice (cooking)</a></li>
                <li class="-item"><a href="https://diy.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="contractors and serious DIYers">Home Improvement</a></li>
                <li class="-item"><a href="https://money.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="people who want to be financially literate">Personal Finance &amp; Money</a></li>
                <li class="-item"><a href="https://academia.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="academics and those enrolled in higher education">Academia</a></li>
                <li class="-item"><a href="https://law.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="legal professionals, students, and others with experience or interest in law">Law</a></li>
                <li class="-item"><a href="https://fitness.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="physical fitness professionals, athletes, trainers, and those providing health-related needs">Physical Fitness</a></li>
                <li class="-item"><a href="https://gardening.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="gardeners and landscapers">Gardening &amp; Landscaping</a></li>
                    </ul></div><div class="site-footer--col site-footer--category js-footer-col" data-name="Life / Arts"><ul class="-list">
                <li class="-item"><a href="https://parenting.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="parents, grandparents, nannies and others with a parenting role">Parenting</a></li>
                <li class="-item">
                    <a href="https://stackexchange.com/sites#lifearts" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 26 })">
                        <strong>
                            more (10)
                        </strong>
                    </a>
                </li>
        </ul>
    </div>
    <div class="site-footer--col site-footer--category js-footer-col" data-name="Culture / Recreation">
        <ul class="-list">
                <li class="-item"><a href="https://english.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="linguists, etymologists, and serious English language enthusiasts">English Language &amp; Usage</a></li>
                <li class="-item"><a href="https://skeptics.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="scientific skepticism">Skeptics</a></li>
                <li class="-item"><a href="https://judaism.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="those who base their lives on Jewish law and tradition and anyone interested in learning more">Mi Yodeya (Judaism)</a></li>
                <li class="-item"><a href="https://travel.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="road warriors and seasoned travelers">Travel</a></li>
                <li class="-item"><a href="https://christianity.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="committed Christians, experts in Christianity and those interested in learning more">Christianity</a></li>
                <li class="-item"><a href="https://ell.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="speakers of other languages learning English">English Language Learners</a></li>
                <li class="-item"><a href="https://japanese.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="students, teachers, and linguists wanting to discuss the finer points of the Japanese language">Japanese Language</a></li>
                    </ul></div><div class="site-footer--col site-footer--category js-footer-col" data-name="Culture / Recreation"><ul class="-list">
                <li class="-item"><a href="https://chinese.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="students, teachers, and linguists wanting to discuss the finer points of the Chinese language">Chinese Language</a></li>
                <li class="-item"><a href="https://french.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="students, teachers, and linguists wanting to discuss the finer points of the French language">French Language</a></li>
                <li class="-item"><a href="https://german.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="speakers of German wanting to discuss the finer points of the language and translation">German Language</a></li>
                <li class="-item"><a href="https://hermeneutics.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="professors, theologians, and those interested in exegetical analysis of biblical texts">Biblical Hermeneutics</a></li>
                <li class="-item"><a href="https://history.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="historians and history buffs">History</a></li>
                <li class="-item"><a href="https://spanish.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="linguists, teachers, students and Spanish language enthusiasts in general wanting to discuss the finer points of the language">Spanish Language</a></li>
                <li class="-item"><a href="https://islam.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="Muslims, experts in Islam, and those interested in learning more about Islam">Islam</a></li>
                    </ul></div><div class="site-footer--col site-footer--category js-footer-col" data-name="Culture / Recreation"><ul class="-list">
                <li class="-item"><a href="https://rus.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="&#x43B;&#x438;&#x43D;&#x433;&#x432;&#x438;&#x441;&#x442;&#x43E;&#x432; &#x438; &#x44D;&#x43D;&#x442;&#x443;&#x437;&#x438;&#x430;&#x441;&#x442;&#x43E;&#x432; &#x440;&#x443;&#x441;&#x441;&#x43A;&#x43E;&#x433;&#x43E; &#x44F;&#x437;&#x44B;&#x43A;&#x430;">&#x420;&#x443;&#x441;&#x441;&#x43A;&#x438;&#x439; &#x44F;&#x437;&#x44B;&#x43A;</a></li>
                <li class="-item"><a href="https://russian.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="students, teachers, and linguists wanting to discuss the finer points of the Russian language">Russian Language</a></li>
                <li class="-item"><a href="https://gaming.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="passionate videogamers on all platforms">Arqade (gaming)</a></li>
                <li class="-item"><a href="https://bicycles.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="people who build and repair bicycles, people who train cycling, or commute on bicycles">Bicycles</a></li>
                <li class="-item"><a href="https://rpg.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="gamemasters and players of tabletop, paper-and-pencil role-playing games">Role-playing Games</a></li>
                <li class="-item"><a href="https://anime.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="anime and manga fans">Anime &amp; Manga</a></li>
                <li class="-item"><a href="https://puzzling.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="those who create, solve, and study puzzles">Puzzling</a></li>
                    </ul></div><div class="site-footer--col site-footer--category js-footer-col" data-name="Culture / Recreation"><ul class="-list">
                <li class="-item"><a href="https://mechanics.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="mechanics and DIY enthusiast owners of cars, trucks, and motorcycles">Motor Vehicle Maintenance &amp; Repair</a></li>
                <li class="-item"><a href="https://boardgames.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="people who like playing board games, designing board games or modifying the rules of existing board games">Board &amp; Card Games</a></li>
                <li class="-item"><a href="https://bricks.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="LEGO&#xAE; and building block enthusiasts">Bricks</a></li>
                <li class="-item"><a href="https://homebrew.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="dedicated home brewers and serious enthusiasts">Homebrewing</a></li>
                <li class="-item"><a href="https://martialarts.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="students and teachers of all martial arts">Martial Arts</a></li>
                <li class="-item"><a href="https://outdoors.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="people who love being outdoors enjoying nature and wilderness, and learning about the required skills and equipment">The Great Outdoors</a></li>
                <li class="-item"><a href="https://poker.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="serious players and enthusiasts of poker">Poker</a></li>
                    </ul></div><div class="site-footer--col site-footer--category js-footer-col" data-name="Culture / Recreation"><ul class="-list">
                <li class="-item"><a href="https://chess.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="serious players and enthusiasts of chess">Chess</a></li>
                <li class="-item"><a href="https://sports.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="participants in team and individual sport activities">Sports</a></li>
                <li class="-item">
                    <a href="https://stackexchange.com/sites#culturerecreation" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 26 })">
                        <strong>
                            more (16)
                        </strong>
                    </a>
                </li>
        </ul>
    </div>
    <div class="site-footer--col site-footer--category js-footer-col" data-name="Science">
        <ul class="-list">
                <li class="-item"><a href="https://mathoverflow.net" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="professional mathematicians">MathOverflow</a></li>
                <li class="-item"><a href="https://math.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="people studying math at any level and professionals in related fields">Mathematics</a></li>
                <li class="-item"><a href="https://stats.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="people interested in statistics, machine learning, data analysis, data mining, and data visualization">Cross Validated (stats)</a></li>
                <li class="-item"><a href="https://cstheory.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="theoretical computer scientists and researchers in related fields">Theoretical Computer Science</a></li>
                <li class="-item"><a href="https://physics.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="active researchers, academics and students of physics">Physics</a></li>
                <li class="-item"><a href="https://chemistry.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="scientists, academics, teachers, and students in the field of chemistry">Chemistry</a></li>
                <li class="-item"><a href="https://biology.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="biology researchers, academics, and students">Biology</a></li>
                    </ul></div><div class="site-footer--col site-footer--category js-footer-col" data-name="Science"><ul class="-list">
                <li class="-item"><a href="https://cs.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="students, researchers and practitioners of computer science">Computer Science</a></li>
                <li class="-item"><a href="https://philosophy.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="those interested in the study of the fundamental nature of knowledge, reality, and existence">Philosophy</a></li>
                <li class="-item"><a href="https://linguistics.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="professional linguists and others with an interest in linguistic research and theory">Linguistics</a></li>
                <li class="-item"><a href="https://psychology.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="practitioners, researchers, and students in cognitive science, psychology, neuroscience, and psychiatry">Psychology &amp; Neuroscience</a></li>
                <li class="-item"><a href="https://scicomp.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="scientists using computers to solve scientific problems">Computational Science</a></li>
                <li class="-item">
                    <a href="https://stackexchange.com/sites#science" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 26 })">
                        <strong>
                            more (10)
                        </strong>
                    </a>
                </li>
        </ul>
    </div>
    <div class="site-footer--col site-footer--category js-footer-col" data-name="Other">
        <ul class="-list">
                <li class="-item"><a href="https://meta.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="meta-discussion of the Stack Exchange family of Q&amp;A websites">Meta Stack Exchange</a></li>
                <li class="-item"><a href="https://stackapps.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="apps, scripts, and development with the Stack Exchange API">Stack Apps</a></li>
                <li class="-item"><a href="https://api.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="programmatic interaction with Stack Exchange sites">API</a></li>
                <li class="-item"><a href="https://data.stackexchange.com" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 25 })" title="querying Stack Exchange data using SQL">Data</a></li>
        </ul>
    </div>

                </div>
            </nav>
            <div class="site-footer--copyright fs-fine">
                <ul class="-list">
                    <li class="-item"><a class="js-gps-track -link" data-gps-track="footer.click({ location: 2, link:4 })" href="https://stackoverflow.blog?blb=1">Blog</a></li>
                    <li class="-item"><a href="https://www.facebook.com/officialstackoverflow/" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 31 })">Facebook</a></li>
                    <li class="-item"><a href="https://twitter.com/stackoverflow" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 32 })">Twitter</a></li>
                    <li class="-item"><a href="https://linkedin.com/company/stack-overflow" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 33 })">LinkedIn</a></li>
                    <li class="-item"><a href="https://www.instagram.com/thestackoverflow" class="-link js-gps-track" data-gps-track="footer.click({ location: 2, link: 36 })">Instagram</a></li>
                </ul>

                <p class="mt-auto mb24">
site design / logo &#169; 2020 Stack Exchange Inc; user contributions licensed under <a href="https://stackoverflow.com/help/licensing">cc by-sa</a>.                    <span id="svnrev">rev&nbsp;2020.6.18.37100</span>
                </p>
            </div>
        </div>

    </footer>

            <script>StackExchange.ready(function () { StackExchange.responsiveness.addSwitcher(); })</script>
    <noscript>
        <div id="noscript-warning">Stack Overflow works best with JavaScript enabled
            <img src="https://pixel.quantserve.com/pixel/p-c1rF4kxgLUzNc.gif" alt="" class="dno">
        </div>
    </noscript>

        <script>
(function(i, s, o, g, r, a, m) {
                i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function() { (i[r].q = i[r].q || []).push(arguments) }, i[r].l = 1 * new Date(); a = s.createElement(o),
                m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m);
            })(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga');

            StackExchange.ready(function () {

                StackExchange.ga.init({
                    sendTitles: true,
                    tracker: window.ga,
                    trackingCodes: [
                        'UA-108242619-1'
                    ],
                        checkDimension: 'dimension42'
                });



                    StackExchange.ga.setDimension('dimension2', '|bash|shell|date|strftime|');

                    StackExchange.ga.setDimension('dimension3', 'Questions/Show');


                StackExchange.ga.trackPageView();
            });
            /**/

            var _qevents = _qevents || [],
            _comscore = _comscore || [];
            (function() {
                var ssl = 'https:' == document.location.protocol,
                    s = document.getElementsByTagName('script')[0],
                    qc = document.createElement('script');
 qc.async = true;
                    qc.src = (ssl ? 'https://secure' : 'http://edge') + '.quantserve.com/quant.js';
                    s.parentNode.insertBefore(qc, s);
                    _qevents.push({ qacct: "p-c1rF4kxgLUzNc" });/**/
 var sc = document.createElement('script');
                    sc.async = true;
                    sc.src = (ssl ? 'https://sb' : 'http://b') + '.scorecardresearch.com/beacon.js';
                    s.parentNode.insertBefore(sc, s);
                    _comscore.push({ c1: "2", c2: "17440561" });            })();
            
</script>

    
    </body>
    </html>
